Skip to main content
Feedback

ServiceNow REST operation

The ServiceNow REST operation defines how to interact with your ServiceNow account and represents a specific action to perform against a specific ServiceNow record type or object.

A record type or object can be a project, an account, a resource, etc. Create a separate operation component for each action/object combination that your integration requires.

The ServiceNow REST operations use JSON format for the request and response profiles, and support the following actions:

  • Get — retrieve a record from ServiceNow.

  • Create — create and insert a record in ServiceNow.

  • Update — update a record in ServiceNow.

  • Delete — remove and delete a record from ServiceNow.

  • Query, Advanced Query — look up ServiceNow records based on specific search criteria.

note

If you receive an error when attempting to import a ServiceNow object (such as a 403 Forbidden authentication error), verify with ServiceNow which account permissions and roles you need. Read access to the sys\_db\_object system table may provide the required access.

Click Import Operation, then use the Import wizard to import the request and response profiles for the selected action. The following fields are available in the import wizard for their respective actions.

Object Types Source (Query, Advanced Query) - Indicate whether to include Tables, Database Views or UI Views in the Object Type list.

  • Tables - Allows you to query and retrieve data from a ServiceNow Table
  • Database Views - Allows you to query and retrieve data from database views, which combines data from multiple tables. This offers a consolidated view without needing to execute multiple API calls across different tables.
  • UI Views - Allows you to see a table and its output schema in the ServiceNow UI.

Display Value (Get, Create, Update, Advanced Query, Query) - Based on this value, retrieves the display value and/or the actual value from the database. The default is to display the actual value.

Filter (Advanced Query, Query, Get, Delete) - You can reduce the number of returned objects in your query by finding the introduced text contained in the display name for tables. The filter property is required.

Enable Dot-Walking (Advanced Query, Query) - Select this checkbox to enable the connector to access any references to other tables it may find in a given table's record and retrieve data from both using dot notation,e.g, table.name. Both single and multiple levels of dot walking are supported.

Dot Walking Depth - This conditional field appears when Enable Dot-Walking is selected. The depth must be at least 1 and no more than 5.

View (Get, Create, Update) - Enter the UI view to determine the fields returned in the response.

No response body (Create, Update) - Turn on to suppress the response body content from ServiceNow and not include information about the new record.

Maximum number of results (Advanced Query and Query) - Indicates the maximum number of documents returned by the operation. If no value is provided, the operation returns all available results. If a value is provided, it must be higher than 0.

Get

Get is an inbound action to retrieve a record (for example, a company or incident record) from a ServiceNow database table based on the ID \(sys\_id\) of the record from the specified table.

When using Get, use the Import Wizard to browse your object definitions in real time to get any fields you have defined. After specifying the criteria, select the record to retrieve from the database. When successful, the connector retrieves information for the selected record. For example, information for a retrieved incident record includes category, cause, due date, impact, severity, and more.

Create

Create is an outbound action to create and insert a record (for example, a problem record) into a ServiceNow database table.

When using Create, use the Import Wizard to browse your object definitions in real time to get any fields you have defined. After specifying the criteria, select the record to insert into the database. When successful, the connector inserts the record. For example, information for an inserted problem record includes who the record is assigned to, a description of the problem, due date, and more.

Update

Update is an outbound action to update an existing record (for example, a problem record) in a ServiceNow database table based on the ID \(sys\_id\) of the record from the specified table.

When using Update, use the Import Wizard to browse your object definitions in real time to get any fields you have defined. Add specifying the criteria, select the record to update in the database. When successful, the connector updates the record. For example, information for an updated problem record includes work notes, the amount of time the problem was worked on, related incidents, and more.

Delete

Delete is an outbound action to remove and delete a record (for example, a problem record) from a ServiceNow database table. The ID \(sys\_id\) for the record to delete is required in the request profile.

When successful, the action deletes the selected record. No JSON document is returned.

Query

Query is an outbound operation to look up ServiceNow records (for example, a problem record) based on specific search criteria.

Query returns zero-to-many object records from a single Query request based on zero or more filters. After you select the Query action and use the Import Wizard, the operation component page contains configuration options to select the fields to return, add filters to limit the results, and select sorting options.

The Import Wizard builds the object list. After you select an object, the Wizard logs into ServiceNow and creates an object tree.

The Fields tab displays all of the fields for the selected table. You can select specific fields for a query, and you can also refine the query by clicking the Filters tab and define multiple expressions and group them into logical sub-groups (up to 3) to create sophisticated query logic.

For example, you can query the problem table and use the AND and OR logical operators to look up problem records for when the assigned\_to field is empty, the active field is true, and the approval field is not requested. The operator at the logical group level defines how the multiple expressions and/or logical sub-groups with that logical group are evaluated.

If you perform a Query operation without defining any filters, the operation returns all of the records in the selected table. You can sort the results of a query by specifying the field values on the Sorts tab. You can sort fields in an ascending or descending order.

Advanced Query

Advanced Query is an outbound operation to look up ServiceNow records (for example, a problem record) based on specific search criteria.

Advanced Query returns zero-to-many records from a single request based on a single, simple expression. After you select the Advanced Query action and use the Import Wizard, you can select the fields to look up and return in the response and add a simple query filter expression. Advanced Query returns JSON documents, supports an "is" filter, and allows you to sort the results with the query expression.

The bottom half of the Operation component page contains tabs on which you configure these options. If you do not select any fields to be returned by the query, the connector returns all fields.

Advanced Query supports a single filter \(\_query\_string\) that is used internally and is mapped to the sysparm\_query parameter to filter the query results. Do not add any other parameters, such as sysparm\_offset and sysparm\_limit, into the query string. Advanced Query correctly paginates the results and returns all records matching the criteria.

Options tab

Tracking Direction - Select the document tracking direction for the operation, either Input Documents or Output Documents. This setting enables you to choose which document appears in Process Reporting. Start steps always track output documents regardless of your selection.

note

If the tracking direction is read-only, the feature to change the direction is either unavailable or the developer set the configuration to read-only. The default value you see shows you which document appears in Process Reporting.

Return Application Error Responses - This setting controls whether an application error prevents an operation from completing:

  • If you clear the setting, the process stops and reports the error on the Process Reporting page.
  • If you select the setting, processing continues and passes the error response to the next component processed as the connection output.

Archiving tab

See the topic Connector operation’s Archiving tab for more information.

Tracking tab

See the topic Connector operation’s Tracking tab for more information.

Caching tab

See the topic Connector operation’s Caching tab for more information.

On this Page