Query records
Return records matching an encoded query (as copied from a ServiceNow list filter).
Command in the ServiceNow toolkit · id ooa.servicenow/query · 14 inputs (1 required), 2 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Instance address (URL) | String | No | Instance URL, e.g. https://yourcompany.service-now.com. | |
| Table | String | Yes | Table name. | |
| Query | String | No | Encoded query. | |
| Fields | List | No | Fields to return, e.g. ["number","short_description","state"]. | |
| Maximum records | Number | No | 1000 | Maximum records. |
| User | String | No | User name (basic sign-in). | |
| Password | Credential | No | Password from the vault. | |
| Access token | Credential | No | OAuth token from the vault (instead of user and password). | |
| Display value | String | No | true | true: display values (e.g. user names); false: stored values (e.g. sys_ids); all: both, as field and dv_field. |
| Order by | String | No | Field to sort by; put - in front for newest or largest first, e.g. -sys_created_on. | |
| Offset | Number | No | 0 | Skip this many matching records first (for paging). |
| Exclude reference link | Boolean | No | true | Leave out the API links of reference fields. |
| Filter | Dictionary | No | Field to required value, all of which must match; combined with query when both are given. No query syntax needed. | |
| API version | String | No | Version of the ServiceNow REST API to call: v1, v2, or latest (the instance's current one) when empty (G6). |
Outputs
| Output | Type | What it is |
|---|---|---|
| table | Table | Records. |
| count | Number | Number of records. |