Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Encoded query strings

An encoded query string represents a complex filter on a list of records.

Use encoded query strings to include a filter as part of a URL parameter, such as the Navigate to a record or module using a URL, or as a reference qualifier to restrict the data that is selectable for a reference field.

To construct an encoded query string, generate a list query and then copy it from the list filter. This is the preferred method because the alternative is to create the string manually.

In order to create an encoded query string manually, you need to know the relevant table and field names and operators.

TitleExample
Referring to Boolean or string valuesTo create a query string on Boolean fields, use this syntax: field=true or field=false. For example, to return only active records in a table, use:
active=true
To create a query string with a field that has a specific string value, use this syntax: field=value. For example, to return incident records where the category is network, use: ``` category=network
</td></tr><tr><td>

Referring to reference fields

</td><td>To create a query string that refers to a reference field in another table, use this syntax: field_in_referenced_table=value. For example, to return users with the itil role in the <strong>Assigned to</strong> reference field on the Incident form, use:<code>Assigned_to.roles=itil</code></td></tr><tr><td>

Referring to choice list values

</td><td><p>To create a query string that refers to a <a href="../../platform-administration/c_ChoiceLists/">choice list</a> option, use the value of the choice list, not the label, with this syntax: choice list field=value. For example, to return configuration items (CIs) with the status <strong>Installed</strong>, which has a value of 1 in the choice list, use:<code>install_status=1</code></p>
<p>See <a href="../../platform-administration/c_DetermValsAssocWChoicesScripting/">Values to associate with choice labels for scripting</a> to find the options for the values.</p></td></tr><tr><td>

Using multiple conditions

</td><td>

To use two conditions joined by an AND operator, use the carat ^ symbol in this syntax: field1=value1^field2=value2. For example, to return all active users with the "itil" role, use:
active=true^roles=itil
 To use two conditions joined by an OR operator, use the carat symbol with OR with this syntax: field1=value1^ORfield1=value2. For example, to return all users with either the "itil" or "admin" roles, use:

 ```
roles=itil^ORroles=admin
To use condition by the LIKE operator, use the syntax:fieldLIKEsubstring. For example, to return all users with roles containing the string "it", use:
rolesLIKEit
To use condition by an IN operator, use the syntax: fieldINvalue1,value2,value3. For example, to return all users with roles that are either "itil", "admin", or "user", use:
rolesINitil,admin,user
To add multiple conditions where one condition is a JavaScript function, use this syntax: javascript:'field=value^' + function\(\). The function must return a string that can be concatenated with the first string to produce a valid query string. For example, to return all active users and meet the conditions of the getGroupQualifier\(\) function, use: ``` javascript:'active=true^' + getGroupQualifier()
</td></tr><tr><td>

Listing values in order

</td><td><p>To sort data by a specific field, use the ORDERBY condition with the following syntax: field1=value^ORDERBYfield2.For example, to return the days of the week in order from the Day of the Week [sys_cal_unit] table, use:</p>
<p><code>unit_name=day^ORDERBYvalue</code></p>
<p>In the Day of the Week table, unit_name is the field that specifies day, week, or month, and value is a numerical value for each day from 1 (Monday) to 7 (Sunday). The query string returns a list of the days of the week in order from the lowest value, which represents Monday, to the largest value, which represents Sunday.</p>
<p><strong>Note:</strong> Reference qualifiers do not support the ORDERBY condition. In reference qualifiers, you can sort the reference lookup list by using standard list controls. To specify the order of an auto-complete list for a reference field, use the ref_ac_order_by dictionary attribute.</p></td></tr><tr><td>

Including a related list query

</td><td><p>At the end of the query statement, enclose the related list information with ^RLQUERY and ^ENDRLQUERY and the quantity. For example, in a query on the Problem table that includes problems with at least one related incident, use:
^RLQUERYincident.problem_id,>=1^ENDRLQUERY
 You can also specify conditions on the related table. For example, to include the condition that at least one of the related incidents is critical priority, use:

 ```
^RLQUERYincident.problem_id,>=1,priority=1^ENDRLQUERY

Note: Related list queries must be enabled in System Properties List v3. Select the Allow related list query conditions to be added through the filter check box to enable it.

You can build a related list query for a list that uses List v2, however, the filter conditions cannot be modified until you removed the related list condition in the breadcrumb.

Including a search term queryTo include a search term in a query, use the 123TEXTQUERY321 reserved variable. For example, to return results with the 'email' search term, use this encoded query string. ``` 123TEXTQUERY321=email
</td></tr><tr><td>

Including a text index group query

</td><td>

To include a text index group in a query, use the 123TEXTINDEXGROUP321 reserved variable. For example, to return results within the portal\_index\_group text index group in the Text Index Groups \[ts\_index\_group\] table, use this encoded query string.

 ```
123TEXTINDEXGROUP321=portal_index_group

Parent Topic:Filters and breadcrumbs