ServiceNow Query

On this Page

Snap type:

Read


Description:

This Snap connects to the particular instance provided by ServiceNow, executes the query and fetches the records or keys depending on the chosen action, and returns the result as a document stream.

  • Expected upstream Snaps: Any Snap that provides a document output view such as a Mapper Snap.
  • Expected downstream Snaps: None or any Snap that has a document input view such as a Filter or a Data or a JSON Formatter.
  • Expected input:  A Table Name and a search query.
  • Expected output:  Return records as query results.
Prerequisites:

None


Support and limitations:
  • Works in Ultra Tasks.

    In Ultra Pipelines, set the Page size as 1 for the Snap to process one document/record at a time.

Account: 

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring ServiceNow Accounts for information on setting up this type of account.


Views:
Input

This Snap has at most one document input view.

Output

This Snap has exactly one document output view. If no results are found, an empty document is written to the output.

Error

This Snap has at most one error view and produces zero or more documents in the view.

Settings

Label



Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

Table name

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


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..

Example: incident

Default value: [None]

API type


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

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

Default value: default

Query


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

Example: active=true
Default value: [None] 

  • 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.

Fields


This property specifies the fields to be retrieved from the table.
Note: This property works only when API type is selected as 'table'.

Display value


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

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

Minimum Value: 1

Maximum Value: 500

Default Value: 500

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

Display variables


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

  • true=display
  • false=do not display

Default value: Selected

Pass through

 

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


Default value: Selected


Allow empty query result

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: Not selected

Number of retries

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

Example: 3

Minimum value: 0

Default value: 0

Retry interval (seconds)

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

Example: 3

Minimum value: 1

Default value: 1

Snap Execution

Select one of the following three modes in which the Snap executes:

  • 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.

Default Value: Execute only
Example: Validate & Execute

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

Example


The example assumes that you have configured & authorized a valid ServiceNow account (see Configuring ServiceNow Accounts) to be used with this Snap.  

The following ServiceNow Query Snap shows how you can query and retrieve records from a ServiceNow table. The following Snap queries the incident table. The Snap specifies that the query results include only some of the columns (Such as active, upon_approval, location, impact, urgency) in the incident table.

When the API type is set to default, the Query field specifies the filter condition. When the API type is set to table, the Fields field specifies the filter condition. In the below example, if the API type is specified as default, then the specified Query searches the active column and returns all the records that have the column field value as true (active=true). 


 

After successful validation of the Snap, you will see a data preview that shows the query results: 

You can also learn how to use ServiceNow Query Snap from the example pipeline (Pipeline: Data from Salesforce.com and ServiceNow).

Snap Pack History

 Click to view/expand
Release Snap Pack VersionDateType  Updates

August 2024

main27765

 

Stable

Upgraded the org.json.json library from v20090211 to v20240303, which is fully backward compatible.

May 2024

main26341

 

Stable

Updated and certified against the current SnapLogic Platform release.

February 2024main25112 StableUpdated and certified against the current SnapLogic Platform release.
November 2023435patches24712 Latest

The Batch Size field is now relabeled to Page size in ServiceNow Query and ServiceNow Insert Snaps.

November 2023main23721 StableUpdated and certified against the current SnapLogic Platform release.
August 2023main22460 StableUpdated and certified against the current SnapLogic Platform release.

May 2023

main21015 

Stable

Upgraded with the latest SnapLogic Platform release.

February 2023main19844 StableUpgraded with the latest SnapLogic Platform release.
November 2022main18944 StableUpgraded with the latest SnapLogic Platform release.
August 2022main17386 StableUpgraded with the latest SnapLogic Platform release.
4.29main15993 StableUpgraded with the latest SnapLogic Platform release.
4.28main14627 StableAdded a new account type ServiceNow OAuth2 that enables OAuth2 authentication for all the ServiceNow Snaps.
4.27main12833 StableUpgraded with the latest SnapLogic Platform release.
4.26main11181 StableUpgraded with the latest SnapLogic Platform release.
4.25 Patch425patches10014 Latest

Enhanced the ServiceNow Query Snap with the Retry mechanism that includes the following fields:

  • Number Of Retries: Specifies the number of attempts the Snap should make to perform the selected operation in case of connection failure or timeout.
  • Retry Interval (seconds)Specifies the minimum number of seconds the Snap must wait before each retry attempt.
4.25main9554
 
StableUpgraded with the latest SnapLogic Platform release.
4.24main8556
StableUpgraded with the latest SnapLogic Platform release.
4.23main7430
 
StableUpgraded with the latest SnapLogic Platform release.
4.22main6403
 
StableUpgraded with the latest SnapLogic Platform release.
4.21snapsmrc542

 

Stable

Adds support for ServiceNow Madrid, New York, and Orlando versions.

4.20snapsmrc535
 
Stable

The ServiceNow Query Snap enhances its scope to include both autogenerated and custom fields.

4.19 Patch servicenow8260 Latest
  • Fixes an issue with the ServiceNow Insert Snap wherein the output provides zero counts if it includes any error records.
  • Fixes an issue with the ServiceNow Update Snap wherein 403 error occurs while fetching schema.
4.19snaprsmrc528
 
Stable

The Snap Pack supports the Madrid release of ServiceNow.

4.18snapsmrc523
 
StableUpgraded with the latest SnapLogic Platform release.
4.17ALL7402
 
Latest

Pushed automatic rebuild of the latest version of each Snap Pack to SnapLogic UAT and Elastic servers.

4.17snapsmrc515
 
Latest
  • Added Batch Size property to ServiceNow Insert and ServiceNow Query Snaps, that enables you to configure the number of documents that you want to process per batch. You can configure the Batch Size for Ultra Tasks as well. 
  • Added the Snap Execution property to all Standard-mode Snaps. In some Snaps, this field replaces the existing Execute during preview check box.
4.16 Patch servicenow6897 Latest

ServiceNow Snaps will not support parsing logic for JSON version. All JSON versions must be replaced with JSON2.

4.16snapsmrc508
 
StableUpgraded with the latest SnapLogic Platform release.
4.15snapsmrc500
 
StableUpgraded with the latest SnapLogic Platform release.
4.14snapsmrc490
 
StableUpgraded with the latest SnapLogic Platform release.
4.13

snapsmrc486

 
StableUpgraded with the latest SnapLogic Platform release.
4.12

snapsmrc480

 
StableUpgraded with the latest SnapLogic Platform release.
4.11snapsmrc465
 
Stable

Added Jakarta support to the Snap Pack.

4.10

snapsmrc414

 
StableUpgraded with the latest SnapLogic Platform release.
4.9.0 Patch servicenow3065 Latest

Addressed an issue with a query against SNOW showing duplicates that aren't present outside of SnapLogic.

4.9snapsmrc405
 
StableUpgraded with the latest SnapLogic Platform release.
4.8

snapsmrc398

 
StableUpgraded with the latest SnapLogic Platform release.
4.7.0 Patch servicenow2183 Latest

Pass through option support added for table API in ServiceNow Query.

4.7

snapsmrc382

 
StableUpgraded with the latest SnapLogic Platform release.
4.6.0 Patch servicenow1884 Latest

Implemented an option to keep the pre-4.6 behavior of ServiceNow Query Snap; Resolved an issue of extra blank line in the ServiceNow Query result set.

4.6snapsmrc362
 
StableUpgraded with the latest SnapLogic Platform release.
4.5.1

snapsmrc344

 
Stable
  • Support for Helsinki added.
  • Fixed an error in record insertion for ServiceNow Insert Snap.
  • Enhanced error reporting in ServiceNow Delete Snap when sys_id is invalid.
4.5

snapsmrc344

 Latest
  • Support for Geneva added.
  • Resolved an issue in ServiceNow Insert & Update Snap to ensure correct target schema generation for the tables.
  • Resolved an issue in ServiceNow Query Snap that occurred when validating account details.
  • Resolved an issue in ServiceNow Insert Snap that occurred when record insertion.


4.4.1- StableUpgraded with the latest SnapLogic Platform release.
4.4- StableUpgraded with the latest SnapLogic Platform release.