SERVICENOW Query records function

The SERVICENOW Query records function in RPA.

Help CentreFunctions & Formulas

This article describes the RPA ServiceNow connector function to query records from a table.

For a full list of available functions, please read SERVICENOW functions.


Description

The Query records function retrieves records from a ServiceNow table using encoded query strings. Supports field selection, display value control, and auto-pagination. Common tables include incident, sys_user, change_request, and problem.


Setting it up

{{popups:rpas/add:action=servicenow-query}}

Once on a process map:

  1. Navigate to the process where you would like to add the function
  2. Click on the green button’s drop-down (right side of the green button labelled “Process”)
  3. On the menu that appears, click on the “+ Activity” item
  4. From here you can select the SERVICENOW Query records option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
ConnectorYesSelect-Select the ServiceNow connector to use
TableYesText-Table name (e.g. incident, sys_user, change_request)
QueryNoText-Encoded query string (e.g. active=true^priority=1)
FieldsNoText-Comma-separated fields to return
Display valueNoSelectfalseReturn display values: true, false, or all
VariableYesText-Variable to store the results

Output variables

VariableTypeDescription
VariableArrayArray of records matching the query

Errors

  • Table not found – the table name is invalid
  • Authentication failed – credentials are incorrect
  • Insufficient rights – user lacks read access to the table

Tips

  • Use encoded query syntax: active=true^priority=1^category=hardware
  • Use ^ for AND, ^OR for OR conditions
  • Set display value to 'all' to get both sys_id references and display text
  • Limit returned fields for better performance

Related functions

  • Get record – Get a single record by sys_id
  • Aggregate query – Get counts and sums
  • Create record – Create a new record

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.