---
sourceDocument: Yokohama ServiceNow AI Platform user interface
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/platform-user-interface

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama ServiceNow AI Platform user interface

ft:clusterId :

    - platux

bundleId :

    - platux

workflow :

    - Platform


---

# Encoded query strings

# Encoded query strings {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read

Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Encoded Query Strings

Encoded query strings allow ServiceNow customers to filter lists of records through URL parameters and reference qualifiers.
This functionality is essential for refining data access and ensuring users interact with relevant records effectively.
Show full answer Show less  

## Key Features

* **Structured Query Creation:** Generate encoded query strings by copying from a list filter or manually constructing them using specific table and field names.
* **Boolean and String Filters:** Use syntax like `field=true` for Boolean values or `field=value` for specific string values.
* **Reference Fields:** Construct queries for reference fields using `fieldinreferencedtable=value`.
* **Choice List Values:** Query choice lists by their values, not labels, e.g., `installstatus=1`.
* **Combining Conditions:** Use operators like AND (`^`), OR (`^OR`), LIKE, and IN to create complex queries.
* **Sorting and Related Lists:** Include sorting with `ORDERBY` and related list conditions with `^RLQUERY`.
* **Search and Index Queries:** Incorporate search terms and text index groups using reserved variables like `123TEXTQUERY321`.

## Key Outcomes

By utilizing encoded query strings, ServiceNow customers can efficiently filter records and enhance data management. This leads to improved data retrieval, streamlined workflows, and tailored user experiences within the ServiceNow platform. Users can expect to simplify complex queries and refine their results to meet specific needs in their applications.  
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](https://www.servicenow.com/docs/uT4cO5~ubSBytUcYHh7uDw "Users can navigate to a record or module directly by using a URL. This topic explains the URL schema by which the system renders pages."), or as a
[reference qualifier](https://www.servicenow.com/docs/access?context=c_ReferenceQualifiers&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) 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](https://www.servicenow.com/docs/kHSuJOaU41gJtNZanUuwhw "You can generate an encoded query string through a filter on any list and paste the string into a URL query or a reference qualifier."). 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](https://www.servicenow.com/docs/CphqfRkQF3QQ9Rax0lAq9w "The system provides a set of operators for use with filters, condition builders, and encoded queries. The data type of a field determines what operators are available for it.").  
{#c_EncodedQueryStrings__table_hkc_kvp_pq__entry__2}

| Title | Example |
|-|-|
| Referring to Boolean or string values | To 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 |
| Referring to reference fields | 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 Assigned to reference field on the Incident form, use: Assigned_to.roles=itil |
| Referring to choice list values | To create a query string that refers to a [choice list](https://www.servicenow.com/docs/access?context=c_ChoiceLists&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) 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 Installed, which has a value of 1 in the choice list, use: install_status=1 See [Values to associate with choice labels for scripting](https://www.servicenow.com/docs/access?context=c_DetermValsAssocWChoicesScripting&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) to find the options for the values. |
| Using multiple conditions | 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() |
| Listing values in order | 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: unit_name=day^ORDERBYvalue 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. Note: 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. |
| Including a related list query | 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 query | To 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 |
| Including a text index group query | 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 |
[Table 1. Encoded query string examples]

{#c_EncodedQueryStrings__table_hkc_kvp_pq}
* **[Generate an encoded query string through a filter](https://www.servicenow.com/docs/kHSuJOaU41gJtNZanUuwhw)**   
  You can generate an encoded query string through a filter on any list and paste the string into a URL query or a reference qualifier.

