Skip to main content

ServiceNow Reader

Reads ServiceNow tables. For full table access, the ServiceNow user account must have the admin and snc_read_only roles. For per-table access, the ServiceNow user account must have the sys_db_object and sys_glide_object roles at the row level and field level ACL as well as the personalize_dictionary role. See Access control list rules in ServiceNow's documentation for details on how to create access privileges for users.

To generate the Client ID and Client secret properties, set up an OAuth application endpoint as directed in the ServiceNow documentation.

In this release, ServiceNow Reader sends only INSERT and UPDATE operations, not DELETE operations. Thus when replicating to a target, data deleted in the source will remain in the target.

ServiceNow Reader properties

property

type

default value

notes

Batch API

Boolean

True

With the default value of True, multiple requests for different tables into a single batch API request.

Set to False to use a separate table API request for each fetch.

Client ID

encrypted password

client ID given by the ServiceNow account user to enable third-party access (see Encrypted passwords)

Client Secret

encrypted password

client secret given by the ServiceNow account user to enable third-party access (see Encrypted passwords)

Connection Retries

Integer

3

The number of times Striim try to connect before halting the application.

Connection Timeout

Integer

60

Number of seconds Striim will with for a connection before retrying (see Connection Retries) or halting the application. With the default setting of 60 and the default Connection Retries setting of 3, if a connection attempt does not succeed within 60 seconds, the adapter will try again. If the second attempt does not succeed within 60 seconds it will try a third time. If the third try is unsuccessful, the application will halt.

Connection URL

String

URL of the ServiceNow instance

Excluded Tables

String

Optionally, specify tables to exclude from the query. Does not support wildcards.

Fetch Size

Integer

10000

the number of records to fetch for a single paginated API call for a given table

Max Connections

Integer

20

number of connections for the HTTP client pool

Mode

enum

Supported values:

  • InitialLoad: Captures all the data for specified tables from the given start timestamp to the current timestamp. Stops after synchronizing with the current timestamp.

  • IncrementalLoad: Captures ongoing data changes for the specified tables from the given start timestamp. By default, the start timestamp is the current timestamp. Continues to run based on the given poll interval.

  • InitialAndIncrementalLoad: Combines initial and incremental mode. Uses start timestamp and poll interval.

Password

encrypted password

the password of the ServiceNow account (see Encrypted passwords)

Polling Interval

String

120

This property controls how often the adapter reads from the source. By default, it checks the source for new data every two minutes (120 seconds). If there is new data, the adapter reads it and sends it to the adapter's output stream.

Start Timestamp

String

When this property is not specified, only new data is read. Optionally, specify the timestamp from which the adapter will read.

The timestamp format is YYYY-MMM-DD HH:MM:SS. For example, to start at 5:00 pm on February 1, 2020, specify 2020-FEB-01 17:00:00.

Tables

String

The table(s) or view(s) to be read. The SQL wild card character % may be used. For example, inc% will read all tables with names that start with "inc".

Thread Pool Count

String

10

The number of parallel threads used to read from the specified tables. For optimal performance, set to the number of tables to be read divided by 40.

Username

String

User ID of a ServiceNow account.

The output type is WAEvent.

ServiceNow Reader monitoring

The ServiceNow Reader monitors the following metrics.

Metric name

Read timestamp

Number of inserts

Number of updates

CPU

CPU rate

CPU rate per node

Number of servers

Number of events seen per monitor snapshot interval

Source input

Source rate

Input

Input rate

Rate

Last event position

Latest activity

Read lag

Table-level information

Table name

ServiceNow Reader example

Use the following cURL command (see Using cURL in the REST Examples and curl.haxx.se) to verify your configuration and get information about available resources.

curl -X GET \
  'https://< your ServiceNow instance >.service-now.com/api/now/table/sys_db_object?sysparm_fields=name%2Csuper_class' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer YWRtaW46RGJCcHY4ZzJFUWdK' \
  -H 'content-type: application/json'

The following TQL will read from the snow2fw_source table:

CREATE SOURCE asnow2fw_source USING ServiceNowReader 
(
  Mode:'InitialLoad',
  PollingInterval:'1',
  ClientSecret:'********',
  Password:'********',
  Tables:'u_empl',
  UserName:'myusername',
  ClientID:'********',
  ConnectionUrl:'https://myinstance.service-now.com/'
)
OUTPUT TO snow2fw_stream;