ServiceNow Query

Overview

The ServiceNow Query Snap connects to a ServiceNow instance, executes a query, and fetches records or keys depending on the chosen action, returning the result as a document stream.

  • This is a Read-type Snap.

Limitations

Works in Ultra Tasks when the Batch size is set to 1. In Ultra Pipelines, set the Page size as 1 for the Snap to process one document/record at a time.

Snap views

Type Description Examples of upstream and downstream Snaps
Input

This Snap has at most one document input view.

A Table Name and a search query.

Output

This Snap has exactly one document output view.

If no results are found, an empty document is written to the output.

Return records as query results.

Learn more about Error handling.

Supported Accounts

Snap settings

Legend:
  • Expression icon (): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field/Field set Description
Label

String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: ServiceNow Query

Table name

String/Expression/ Suggestion

Required. The name of the table in the instance. The table name is suggestible but requires an account setting for the suggestions to appear.

Note: Only accounts that have the 'Personalize dictionary' role can see the field labels associated with each table in the ServiceNow data dictionary. Therefore, accounts used with Snaps in this Snap Pack must have the 'Personalize dictionary' permission if you want to view the Table name suggestions.

Default value: N/A

Example: incident

API type

Dropdown list

Required. A property that determines which API to be used. Options available include:

  • default: For default behavior
  • table: For querying using ServiceNow table API
Note: Default API does not support OrderBy in the Query Field due to ServiceNow Limitation.

Default value: default

Query

String/Expression

An encoded query string to filter the records. For more information, see Encoded Query Strings.

Note:
  • Use the Dollar sign ($) when querying custom fields created in ServiceNow. Example: $incident_state=New.
  • Do not use the Dollar sign ($) when querying fields that are auto-generated by ServiceNow. Example: active=true.

Default value: N/A

Example: active=true

Fields

String/Expression

This property specifies the fields to be retrieved from the table.

Note: This property works only when API type is selected as table.

Default value: N/A

Display value

Dropdown list

A property that determines whether to display values for the reference fields.

  • true: Display reference field
  • false: Do not display
  • all: Display both reference field and its value

Default value: true

Page size

Integer/Expression

Required. Number of documents for processing in a single batch.

Minimum Value: 1

Maximum Value: 500

Note: Set the value as 1 when using the Snap in an Ultra Pipeline.

Default value: 500

Display variables

Checkbox

A property that determines whether to display composite fields in a hierarchical order.

  • true: Display
  • false: Do not display

Default value: Selected

Pass through

Checkbox

If selected, the input document will be passed through to the output view under the key 'original'.

Default value: Selected

Allow empty query result

Checkbox

A property that determines whether the query for an empty result is allowed or not. If selected, the Snap writes an empty document when it fetches no records. Otherwise, an exception is thrown.

Default value: Deselected

Skip records without sys_id

Checkbox

Select this checkbox if you want the Snap to skip records that do not contain a sys_id entry in the query result and proceed to processing the next record.

Default value: Deselected

Number of retries

Integer/Expression

Specifies the maximum number of retry attempts when the Snap fails to read.

Minimum value: 0

Default value: 0

Example: 3

Retry interval (seconds)

Integer/Expression

Specifies the minimum number of seconds the Snap must wait before each retry attempt.

Minimum value: 1

Default value: 1

Example: 3

Snap execution

Dropdown list

Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Additional information

For more information on how to define the Action and Query, see Action Parameters.