You can create filter conditions to subscribe to data only when certain conditions are met. For more information about creating filter conditions in ServiceNow, see condition builder.

Prerequisites


(warning) First, you will need to get started with DataSync Express.

Procedure

To create filter conditions for a subscribe, follow these steps:


Create a new Subscribe

Log into your sharing ServiceNow instance and navigate to Perspectium DataSync Express > Subscribe > New to create a new subscribe.

Build your conditions

(info) NOTEYou will need to select a table for the subscribe first to use the Condition option.

Go down to the Condition option on the Data Enrichment tab and choose a field to filter on from the choose field dropdown.

Then, add an operator for your filter condition statement (For a list of ServiceNow operators and their descriptions, see operators available for filters and queries). Finally, enter/select a value for your filter condition statement.

(Optionally) Use a Condition script

You can also use the Condition script to filter out subscribing to a record with the following variables available to use:

Variable

Description

qcurrent

The GlideRecord of the x_perr2_datasync_psp_in_message record to represent the message as read from the Integration Mesh. This way you can access fields such as topic, type, key, name and value.

For example, if you want to skip any records based on the key field since the key represents different instances you're subscribing to data from:

if (qcurrent.key == "acmeprod") {
 answer = false;
}
answer

To prevent the current record from being subscribed into the target table of the subscribe configuration, you can set the variable answer to false in the Condition script.

For example, the following script ignores subscribing any incident record when the priority field value is 1:

if (current.priority == 1) {
    answer = false;
}

Save your changes

Near the bottom left-hand corner of the form (just above Related Links), save the changes to your dynamic share.