The components of a query

A query typically includes the following parameters:

Note: Refer to the article, What are the most common actions that affect QuickBase performance?, for tips on optimizing performance when creating queries.

The Query parameter

The query parameter determines which records are returned. You can build a new query string inside the <query></query> tag or you can choose to reference a saved query string using the <qid> or <qname> tags.

Building the query string

When you build a query, you must build at least one query string. A query string is composed of:

You should separate each of these query string components using a period and enclose the entire query string in curly braces, as shown below:



<query>{'5'.CT.'Ragnar Lodbrok'}</query>

This example specifies that QuickBase should return all records where the “fid 5” field contains the value “Ragnar Lodbrok.”

Grouping multiple query strings

You can group several of query strings together, separating the query strings with the AND or OR operators, as shown here:


<query>{'5'.CT.'Ragnar Lodbrok'}AND{'7'.CT.'Acquisitions'}</query>

The next example illustrates how to group query strings together when using a URL:


&query={'5'.CT.'Ragnar Lodbrok'}AND{'7'.CT.'Acquisitions'}

Note: You can obtain the fids for a table by calling API_GetSchema, or from any call to API_DoQuery that sets the fmt parameter to “structured.”

Query string comparison operators

Comparison Operator Description



(Do not use this operator with list-user fields; instead, use HAS.)


Does not contain

(Do not use this operator with list-user fields; instead, use XHAS.)


Contains a specific set of users. Used with list-user fields only.

For each user you are trying to find, you must enter the user's ID, user name, or email address. You can also enter placeholder names. Be sure to surround placeholder names with double quotes.

The query parameter must be surrounded by single quotes.

Separate users in the list using a semicolon.

For example:

<query>{'6'.HAS.'-8675309; -9873297'}</query>


Does not contain a specific set of users.  Used with list-user fields only.

The query parameter must contain the user's ID, email address, or user name. You can also specify a placeholder name. Placeholder names must be enclosed in double quotes.

The entire query parameter must be surrounded by single quotes. Separate users in the list using semicolons.

Note that a matching record must contain all users you specify. This query:

<query>{'6".XHAS. '-8675309; -9873297'}</query>

...specifies that you want to see records that do not contain BOTH of these users. Therefore, the query will return records that contain either one or neither, but not both, of these users.




True Value (compares against the underlying foreign key or record ID stored in relationship fields). Also used for queries on User fields.


Not True Value (compares against the underlying foreign key or record ID stored in relationship fields). Also used for queries on User fields.


Is not


Starts with


Does not start with


Is before


Is on or before a specific date


Is after a specific date


Is on or after a specific date


Is in range. Use this operator with date fields, to determine whether a particular date falls within particular date range relative to the current date. Learn more about relative date ranges.


Is not in range. Use this operator with date fields, to determine whether a particular date falls within a particular date range relative to the current date. Learn more about relative date ranges.


Is less than


Is less than or equal to


Is greater than


Is greater than or equal to

Handling Special Characters for a Query Field Values

If you are searching for a value that includes special characters, be sure to enclose the matching value in quotes. For example, if you are searching for this value:

"Joe B. Briggs" should be sure to enclose the entire string in double quotes, as follows:

""Joe B. Briggs""

Querying on Dates and Times

You can query on dates (yyyy-MM-dd) or on times in milliseconds, but you cannot query on date-time values in the standard "yyyy-MM-dd hh:mm:ss" format.

Special Matching Values in a Query String

Certain field types use special values with a given comparison operator. For example, you may want to query on a Checkbox field. You may want all records where a Checkbox is either checked or not. In cases like this, you can use special matching values in your query string to return records with the value you want.

Field Type Description


1 or 0

Date and Date/Time



<num> days ago


-<num> days ago





Referencing a Common Report

In the QuickBase UI, a user can customize a report and save it as a common report, which will then be available as a saved query. Each saved query has an ID (qid) and a user-supplied name (qname). Creating a saved query is an easy and quick way to construct a query, compared to building the query string yourself.

To use a saved query, you refer to it by its qid (e.g., <qid>3</qid>) or by the name you gave it when you saved it (e.g., <qname>My Custom View</qname>. For the qname value, do not replace blanks spaces with underscore.

You can use API_DoQuery to get the qid and qname of common reports. If you use the fmt parameter, QuickBase returns a list of all saved queries inside a <queries> aggregate, including their qid and qnames. (You can also use API_GetSchema to get the qid or qname of a saved query).

QuickBase tables have two default saved queries: List All, and List Changes.

Column List (clist) Parameter

The clist specifies which columns will be included in each returned record and how they are ordered in the returned record aggregate.

XML Example:


URL Example:


...where each number is the fid of the field (column) you want returned, with a period separating the fids. The columns will be listed in the returned record in the same order as they appear in the clist. If you don’t specify a clist, QuickBase returns your table’s default columns and order.

If no column list parameter is supplied, the default report layout and field order is used.

To change the default field order, see the QuickBase online help:

How to Return ALL of the columns

Specify the value a in the clist param to specify that all columns should be returned.

Sort List (slist) Parameter

The sort list parameter determines the order in which the returned records are displayed as follows:


The following slist parameter sorts all records by the field whose fid is 7.

XML Example:


You can specify a secondary sort by including another fid in the string (separating each fid with a period)

XML Example:


URL Example:


If you don’t specify the sort list, the default sort specified on the Report Layout page determines the order in which records are displayed.

Options Parameter

You use the options parameter to further control the return of records. You can use any or all of the options, separating the options with a period.

XML Example:


URL Example:


This tells QuickBase to skip the first 15 records the query would normally return and give you the next 15 records. It also specifies that all sorts should be in ascending order.

If you don’t supply the options parameter, the records are sorted in ascending order and the number of records returned will be the same number as the QuickBase is set to return.

About the Sort Order Option

You can apply a different sort order to different returned columns in the clist by supplying several period-delimited sortorder parameters:


This example sorts the first column in the clist in ascending order, the second and third columns in descending order, and the fourth column in ascending order.

The onlynew parameter produces a different result for each user that is logged into QuickBase: it won’t work with the QuickBase anonymous user.

Format Parameter

Use the fmt parameter to specify structured returns. If you don't specify this parameter, query returns are not structured; QuickBase returns the table name, any DBVars, and the record data with the fields you specified, all with the field names, like this:

   <business_phone_number>(123) 103-1234 x12345</business_phone_number>

In contrast, if you specify structured returns using the fmt parameter, QuickBase returns field IDs (fids) instead of field names. QuickBase will also return URLs of file attachments. (For an alternative way to download files without this URL, see Downloading Files.) Using structured format, QuickBase also returns:

When you use structured format, the field data is presented in a more compact form so you can immediately spot the fid and the actual field value.

   <f id="5">112149.bhsv</f>
   <f id="6">(650) 123-1234</f>
   <f id="7"></f>
   <f id="22"> Model_T.jpg

In the example, target_domain is the domain against which you are invoking this call, for example, Read about this notation.


© 1999-2015 Intuit Inc. All rights reserved. Legal Notices.