|
name-value pairs
|
An alternative to using the **sysparm\_query** parameter. You can filter a query using key-value pairs where the key is the name of a field.For example, instead of using the parameter `&sysparm_query=active=true`, you can use `&active=true`. You can use the display value when the field is a choice or reference type field, such as `&state=closed` instead of `&state=7`. To specify multiple key-value pairs, separate each with an ampersand, such as `&active=true&assigned_to=john.smith`.
Data type: String
|
|
sysparm\_<aggregate>\_fields
|
List of fields on which to perform each aggregate operation. You can specify multiple fields by separating each with a comma. For example, to get the average values from the duration and priority fields, use `sysparm_avg_fields=duration,priority`.**Note:** Specify this parameter, the **sysparm\_count** parameter, or both for your query to return meaningful results. If neither parameter is passed, no aggregate operation is performed.
Data type: String
|
|
sysparm\_count
|
Flag that determines whether to return the number of records returned by the query.**Note:** Specify this parameter, the **sysparm\_<aggregate>\_fields** parameter, or both for your query to return meaningful results. If neither parameter is passed, no aggregate operation is performed.
Data type: String
|
|
sysparm\_display\_value
|
Data retrieval operation when grouping by reference or choice fields. Based on this value, the query returns either the display value, the actual value in the database, or both.- true: Returns display values for all fields.
- false: Returns actual values from the database. If a value is not specified, this parameter defaults to false.
- all: Returns both actual and display values.
There is no preferred method for setting this parameter. However, specifying the display value may cause performance issues as they are not read from the database and may reference other fields and records. For more information on display values and actual values, see [Table API FAQs \(KB0534905\)](https://support.servicenow.com/kb_view.do?sysparm_article=KB0534905).Data type: String
|
|
sysparm\_group\_by
|
Fields by which to group the returned data. You can specify multiple fields by separating each field with a comma, such as `sysparm_group_by=priority,state`.Data type: String
|
|
sysparm\_having
|
Additional query that enables you to filter the data based on an aggregate operation. The value for this parameter must follow the syntax `aggregate^field^operator^value`, such as `count^priority^>^3` to obtain the number of records within the query results with a priority greater than 3. You can specify multiple queries by separating each with a comma, such `ascount^state^=^1,avg^priority^>^3`.Data type: String
|
|
sysparm\_order\_by
|
List of values by which to order grouped results. You can specify an order using a field or an aggregate. For example, if you specify `sysparm_order_by=AVG^state`, groups of results with lower average state values are returned first. You can also order by COUNT to arrange groups of records by the number of records in each group.When you specify an order, groups are ordered in ascending order by default. Use `^DESC` to sort in descending order, such as `sysparm_order_by=state^DESC`.
Data type: String
|
|
sysparm\_query
|
An encoded query.For example: `(sysparm_query=active=true)(sysparm_query=caller_id=javascript:gs.getUserID()^active=true)`
Data type: String
|