Skip to main content

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​

InputTypeRequiredDefaultWhat it is
Instance address (URL)StringNoInstance URL, e.g. https://yourcompany.service-now.com.
TableStringYesTable name.
QueryStringNoEncoded query.
FieldsListNoFields to return, e.g. ["number","short_description","state"].
Maximum recordsNumberNo1000Maximum records.
UserStringNoUser name (basic sign-in).
PasswordCredentialNoPassword from the vault.
Access tokenCredentialNoOAuth token from the vault (instead of user and password).
Display valueStringNotruetrue: display values (e.g. user names); false: stored values (e.g. sys_ids); all: both, as field and dv_field.
Order byStringNoField to sort by; put - in front for newest or largest first, e.g. -sys_created_on.
OffsetNumberNo0Skip this many matching records first (for paging).
Exclude reference linkBooleanNotrueLeave out the API links of reference fields.
FilterDictionaryNoField to required value, all of which must match; combined with query when both are given. No query syntax needed.
API versionStringNoVersion of the ServiceNow REST API to call: v1, v2, or latest (the instance's current one) when empty (G6).

Outputs​

OutputTypeWhat it is
tableTableRecords.
countNumberNumber of records.