Creating a Query
  • 05 Mar 2026
  • Dark
    Light
  • PDF

Creating a Query

  • Dark
    Light
  • PDF

Article summary

Queries return exports (data points you select) if the record they’re associated with meets the criteria of any filters you apply.

Creating a query

Go to Queries / Reports. There are two types of queries you can create from this page:

New query

Creates a saved, named query that can be used for data export.

You can share saved queries with other Slate users through Sharing Permissions.

Quick query⚡

Creates an ad-hoc query that is not saved and cannot be used for data export.

These are temporary and designed for short-term use. After a few days, these queries are automatically deleted from your database.

💡 You can preserve a quick query by making a copy.

Choosing a base

The base of your query fills in the blank in this sentence: I want this query to return one row per _______.

Pick the Person base, and the query returns one row per person record that matches your filter criteria; pick Application, and you get one row per application record.

The configurations you see depend on whether you selected new query or quick query:

  1. Configure the following settings:

    • Name: Enter a name for your query.

    • User: Select a user. Defaults to the current user.

    • Realm: Select a realm to which this query should be assigned.

    • Sharing: Check the Sharing check box to share the query with other Slate users who have the appropriate permissions.

    • Folder: Save the query in a folder and, optionally, a subfolder.

    • Type: Select Configurable Joins. The other two options, Local and Slate Template Library, offer limited functionality and shouldn’t be used.

    • Category: Select Records, Related, or System.

    • Base: Based on your choice of Category, select a base. If you don’t see the base you’re looking for, you may need to choose a different category.

    • Population: If you selected a by Population base, make a selection to narrow results from all records on the base to just those within the selected population.

  2. Select Save.

📝 You cannot change the query base after you select Save.

  1. Configure the following settings:

    • Type: Select Configurable Joins. The other two options, Local and Slate Template Library, offer limited functionality and shouldn’t be used.

    • Category: Select Records, Related, or System.

    • Base: Based on your choice of Category, select a base. If you don’t see the base you’re looking for, you may need to choose a different category.

    • Population: If you selected a by Population base, make a selection to narrow results from all records on the base to just those within the selected population.

  2. Select Build Query.

📝 You cannot change the query base after you select Build Query.

You’re brought to the query overview page.

Building the query

You can start building your query by:

  • Adding exports, including subquery exports

  • Adding filters, including subquery filters

  • Joining to other tables

  • Adding sorts to the results

You’ll also find the following configurations:

Edit Properties

Control query settings such as limiting the number of rows returned, adjusting execution options and fetch behavior, selecting a queue or secondary key, and choosing to hide the query from the audit log.

Edit Permissions

Add sharing permissions to a query

Edit Web Services

Export query results as a web service. Requires Administrator (All Access) Role

Schedule Export

Export query results in the selected delivery window.

Preview Results

See a sample of query results before running the query.

Display SQL

View the SQL generated from adding exports, filters and joins.

Snapshots

See when and how the query was edited.

Copy

Create a copy of the current query.

Run Query

Once exports and filters are added, select Run Query to display query results.

Preview Results

See a sample of query results before running the query.

Display SQL

View the SQL generated from adding exports, filters and joins.

Copy

Save the quick query for future use.

📝 When you make a copy of a quick query, update the folder destination.

Adding exports

Exports are the data points associated with each row your query returns. They are analogous to columns in a spreadsheet.

Export

Select Export to add new data to the query.

Literal

Select Literal to add a static value as an export column. Every row in the query results will have the same static value in this column.

Custom SQL

Select Custom SQL to add a custom export column. This option is used for more complex data exports. In many cases, Configurable Joins removes the need for custom SQL exports.

Subquery Export

Configurable Joins query bases include the option to add subquery exports. Subquery exports let you return more complex data in each column, like comma-separated lists, and their results can come from different bases than your original query.

Adding filters

Filters limit the returned rows based on the criteria you define.

Filter

Select Filter to restrict the population of records to be exported. Add as many filters as needed.

Custom SQL

Select the Custom SQL button to add a custom SQL filter. This option is used for more complex data exports. In many cases, Configurable Joins removes the need for custom SQL filters.

OR, NOT, ), and (

When necessary, add OR and NOT logical operators.

📝 You must use parentheses with logic operators.

Subquery filters

Configurable Joins query bases include the option to add subquery filters. Subquery filters greatly expand your filtering capabilities with calculations, comparisons, formulas, and more.

Joins

Joins let you join or combine data from multiple tables or sources in a flexible and customizable manner by creating relationships between data sets, consolidating information from multiple sources into a single view, and manipulating the joined data to meet your specific needs and provide options for you to select which columns to include and specify join conditions.

There is seldom a reason to make a one-to-many join at the main level of a query. For instance, if you wanted to exclude records by making a main join from "Person" to "Tags", Slate would randomly retrieve one tag set for that record: that tag may or may not be the "Test Record" tag. In that case, we would use a subquery filter that joins from "Person" to "Tags" so we can look at all tags associated with a person record:

Sorting results

Sort query results based on one or more data points.


Was this article helpful?