Use the Retrieve activity to get records from standard and custom tables in
ServiceNow.
About this task
Use this task to get records from the table in ServiceNow instance. The call to this activity is
a synchronous call where the input data is sent to the activity for processing and the response is
sent back to the orchestration.
Procedure
- Right click the Orchestrations section and select new orchestration.
- Drag the newly created ServiceNow endpoint to the orchestration and select
Retrieve activity. The Retrieve activity will be added to the orchestration. Double
click the activity.
- In the Checklist, click Configure.
- Click Browse and use the Project Explorer dialog
box to select the relevant ServiceNow table.
- Select the Map Inputs in the Checklist. The XML
Schemas generated for that operation are displayed.
- Create a map between the orchestration variables and the input parameter of the activity.
Mandatory fields:
- is_all_records: to fetch all the records.
- sys_id: to fetch specific record when is_all_records is false.
Customize: To customize the response query_object is used. Below are query_object fields:
- sysparm_display_value: Data retrieval operation for reference and choice fields. Set this
parameter to one of these values,
- true: Returns display values for all of the 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.
- sysparm_exclude_reference_link: Additional information provided for reference fields, such as
the URI to the reference resource, is suppressed.
- sysparm_fields: Comma-separated field names to return in the response.
- sysparm_limit: Limit to be applied on pagination. The default is 10000.
- sysparm_query: An encoded query.
- sysparm_view: UI view to determine fields returned in the response.
Note: Values must be provided at run time for any mandatory elements of the input structure. A value
can be provided by specifying a default value for element or by linking the element with an input
node. During run time if no value is provided for a mandatory element, the activity throws an
exception. If a value is not provided at run time for an optional input parameter, no exception is
thrown during run time.
- Select the Map Outputs in the Checklist. The XML
Schema generated to hold the response of the activity is displayed as nodes under the response
output parameter in the From Activity panel.
- Create a map between the output parameters and orchestration variables.
Results
You have configured the ServiceNow Retrieve activity.
Note: You can add more than one sys_id fields as input to this activity. To add more than one sys_id
fields as input, right click the sys_id field in the To Activity pane of
Map Inputs, and select Expand Occurrences. Only
multiple objects of the same type is supported.