You can use data filters to fetch specific data of a particular object. The synchronization task processes the data based on the filter field assigned to the object.
You can create simple or advanced data filters.
Simple data filters
You can create one or more simple data filters. When you create multiple simple data filters, the associated task creates an AND operator between the filters and loads rows that apply to all simple data filters.
1Select Data Filters tab in a synchronization task.
The Data Filters tab appears.
2Click New.
The Data Filter dialog box appears.
3Specify the following details:
Field Type
Description
Object
Select Object for which you want to assign filter fields.
Filter By
Select the Filter Field.
Operator
Select the operator.
Filter Value
Enter the Filter value.
4Click OK.
Advanced data filters
To run search queries containing complex filter expressions, use the advanced data filter.
1Click Advanced in Data Filter dialog box.
The Advanced Data Filter dialog box appears.
2Enter the Filter Expression.
3Click OK.
The following image shows the Advanced Data Filter page:
Supported data filter operators
ServiceNow supports logical operators that you can use to filter data:
The following table shows the supported operators and the filter usage:
Operator
Symbol
Advanced Filter Usage
Greater than
>
field > value
For example, opened_at > $LastRunTime
Greater than equals
>=
field >= value
For example, sys_updated_on >= SYSDATE-86 AND caller_idIN 62826bf03710200044e0bfc8bcbe5df1,6816f79cc0a8016401c5a33be04be441
Equals
=
field = value
For example, number = INC003451
Less than
<
field < value
For example, opened_at < $LastRunTime
Less than equals
<=
field <= value
Not equal
!=
field != value
Starts with
STARTSWITH
field STARTSWITH value
Ends with
ENDSWITH
field ENDSWITH value
Contains
CONTAINS
field CONTAINS value
Is empty
ISEMPTY
field ISEMPTY value
Is not empty
ISNOTEMPTY
field ISNOTEMPTY value
In
IN
caller_id IN 46c1293aa9fe1981000dc753e75ebeee,
9ee1b13dc6112271007f9d0efdb69cd0
Date
SYSDATE
field > SYSDATE-1
For example, opened_at > SYSDATE-1
And
AND
field operator value AND field operator value
For example, location = a23c49b037d0200044e0bfc8bcbe5dda AND
caller_id = 46c1293aa9fe1981000dc753e75ebeee
Or
OR
field operator value OR field operator value
Between
BETWEEN
field BETWEEN value1,value2
For example, sys_updated_on BETWEEN 2017-03-01,2017-03-31
field BETWEEN SYSDATE-<value>,SYSDATE-<value>
For example, sys_updated_on BETWEEN SYSDATE-14,SYSDATE-1
ORNewQuery
ORNewQuery
query1 ORNewQuery query2
For example, opened_at >= SYSDATE-14 AND opened_at <= SYSDATE-1 ORNewQuery closed_at >= SYSDATE-14 AND closed_at <= SYSDATE-1
Rules and guidelines for data filters
Consider the following rules and guidelines when you apply data filters to filter ServiceNow objects:
•When you configure a filter, the query options does not accept NULL values.
•When you configure a filter condition, use Not Parameterized from the query options.
•For NULL operator, ensure that the <Field name> appears before the <Table name> in the advanced filter condition.
•Do not filter fields that are similar to <table name><Field name>!=null.
•Do not filter fields that are similar to <dv_field name>.
•Open and closed brackets () used in filter conditions are not supported by ServiceNow.
You can instead specify the following operators, or use the formats supported by ServiceNow:
- AND operator for applying AND in simple and complex filter queries.
- OR operator for applying OR in simple queries
- ORNewQuery operator for applying OR for complex queries
For example, Category=Software AND Incident_State=7 ^NQ category=hardware AND Incident_state=1 OR Incident_state=2
For more information about the formats supported by ServiceNow, see the ServiceNow documentation.
•When you configure a filter to read from or write data to ServiceNow and a part of the filter query is not valid, ServiceNow returns rows using only the valid portion of the query and ignores the rest.
•When you configure advanced filters, ensure that the filter condition contains only the field name, operator, and field value. You must remove any additional text that is appended to the filter condition.