ServiceNow (Apps step)

Updated Nov 23, 2026
DataMagik Automate

ServiceNow

Lists, reads, creates and updates records in any ServiceNow table (incidents, change requests, assets…) through the Table API.

Use it to keep ServiceNow in step with the plant: open an incident when a line goes down, list open incidents for a shift report, or update a record when the fix is confirmed.

Beta. This step has not yet been checked against a live ServiceNow account, so treat its first runs as a test, and tell us if an operation does not answer as described.

Find it in the workflow editor's palette under Apps. See Apps steps for what every Apps step has in common.

Set it up

  1. In ServiceNow, have your admin create an integration user (tick "Web service access only") with roles that can read and write the tables the workflow uses, such as itil for incidents.
  2. In DataMagik, open Script Engine › Credentials and add a "Basic Auth (Username/Password)" credential with that user's name and password.
  3. Add your instance's host (such as acme.service-now.com) to Allowed Domains in the workflow's Script settings.

Credential: A Basic credential with a ServiceNow user's name and password, or an OAuth 2.0 credential for an OAuth application registered in your instance (System OAuth › Application Registry); its token URL is https://<instance>.service-now.com/oauth_token.do and, for a person signing in, its sign-in URL is https://<instance>.service-now.com/oauth_auth.do.

Hosts it calls: *.service-now.com

Connection

FieldRequiredWhat to put
InstanceYesThe part of your ServiceNow address before .service-now.com: acme for acme.service-now.com. For example acme.

Operations

OperationWhat it does
Record › ListLists a table's records that match a query, 100 per request, following every page up to the step's page limit.
Record › GetReads one record by its sys_id.
Record › CreateCreates a record in a table.
Record › UpdateChanges fields on one record; fields you leave out keep their values.

Record › List

Lists a table's records that match a query, 100 per request, following every page up to the step's page limit.

Calls GET /table/{table}. Follows the pages, up to Most pages (10 unless you change it).

FieldRequiredWhat to put
TableYesThe table's name, such as incident or change_request. For example incident.
QueryNoAn encoded query that picks the records; leave empty for all of them. Copy one from a filtered list in ServiceNow. For example active=true^priority=1^ORDERBYDESCsys_created_on.
Fields to returnNoComma-separated field names; leave empty for every field. For example number,short_description,state,sys_id.
ValuesNoStored values are what the database holds (a sys_id, the state code 2); display values are what a person sees (a name, In Progress); Both returns each field as {"display_value", "value"}. One of: Stored values, Display values, Both.

What comes out: One item per record, with the fields asked for: {{ $json.sys_id }}, {{ $json.number }}, {{ $json.short_description }}, {{ $json.state }}.

Example: Table incident with query active=true^assignment_group.name=Plant IT lists the open plant incidents for a morning summary email.

Record › Get

Reads one record by its sys_id.

Calls GET /table/{table}/{sys_id}.

FieldRequiredWhat to put
TableYesThe table's name, such as incident or change_request. For example incident.
Record sys_idYesThe record's 32-character sys_id (not its number, such as INC0010001). For example 46d44a5ca9fe198101a5e0a9a2e4b8f1.
Fields to returnNoComma-separated field names; leave empty for every field. For example number,short_description,state,sys_id.
ValuesNoStored values are what the database holds (a sys_id, the state code 2); display values are what a person sees (a name, In Progress); Both returns each field as {"display_value", "value"}. One of: Stored values, Display values, Both.

What comes out: One item: the record, with {{ $json.sys_id }}, {{ $json.number }}, {{ $json.state }} and its other fields.

Example: Read incident {{ $json.snow_sys_id }} to check whether its state is Resolved before releasing the held lot.

Record › Create

Creates a record in a table.

Calls POST /table/{table}.

FieldRequiredWhat to put
TableYesThe table's name, such as incident or change_request. For example incident.
Record fieldsYesA JSON object of field names and values for the new record. Choice fields take their stored value (urgency 2, not Medium); reference fields take a sys_id. For example {"short_description": "Line 3 press down", "urgency": "2", "impact": "2"}.

What comes out: One item: the new record as ServiceNow saved it, with {{ $json.sys_id }}, {{ $json.number }} (such as INC0010042) and its other fields.

Example: Create an incident with short description Label printer {{ $json.printer }} offline when a print job fails, then save {{ $json.number }} with the job.

Record › Update

Changes fields on one record; fields you leave out keep their values.

Calls PATCH /table/{table}/{sys_id}.

FieldRequiredWhat to put
TableYesThe table's name, such as incident or change_request. For example incident.
Record sys_idYesThe record's 32-character sys_id (not its number, such as INC0010001). For example 46d44a5ca9fe198101a5e0a9a2e4b8f1.
Record fieldsYesA JSON object of the fields to change and their new values; only these fields change. For example {"work_notes": "Press restarted at {{ $json.time }}"}.

What comes out: One item: the record as it now is, with {{ $json.sys_id }}, {{ $json.number }}, {{ $json.state }} and its other fields.

Example: When the press is back up, add a work note to incident {{ $json.snow_sys_id }} with {"work_notes": "Restarted by {{ $json.operator }}"}.

Trigger: ServiceNow: New Items

Under Triggers in the palette. It looks at ServiceNow on a schedule (every 15 minutes unless you change Look every) with one of these operations: Record › List, and starts the workflow with the items it has not seen on an earlier look, one item each. Saving the workflow sets up the schedule.

  • New means: not seen before, by the item's id (or the field you name in Item field), or newer than the newest one last time, by a date or increasing number.
  • On the first run it only remembers what is there, unless you choose Start with everything.
  • Test runs show what would be new without remembering it. It remembers the last 5000 ids, so filter the list to keep it shorter than that.

Example

A When a Workflow Fails trigger feeds ServiceNow › Create record in table incident, with {"short_description": "Workflow {{ $json.workflow }} failed", "urgency": "2"}, then saves {{ $json.number }} on the run log.

Tips

  • Table is the table's name, not its label: incident, change_request, sc_req_item, cmdb_ci. Your admin can see it in the list's URL (incident_list.do).
  • The query uses ServiceNow's encoded query syntax. The easiest way to get one is to filter a list in ServiceNow, right-click the breadcrumb and choose Copy query.
  • Reference fields (assigned_to, caller_id) come back as {"link", "value"} with the sys_id in value; set Display values to get the name instead.
  • It calls ServiceNow on test runs too, so create records in a sub-production instance while building.

Settings every Apps step has

  • More query parameters: any query parameter the fields do not offer, sent as is.
  • More body fields: a JSON object merged into the request body; nested objects merge, other values replace.
  • Most requests per second: spaces the calls out for rate limits. A "too many requests" (429) answer is retried after the wait the API asks for.
  • Most pages: for operations that follow pages, the most pages to fetch (10 unless you change it, up to 100). The run warns when it stops with more to get.
  • Fail on a non-2xx response: on by default. Turn it off to handle errors yourself.

ServiceNow's own API documentation: https://developer.servicenow.com/dev.do#!/reference/api/latest/rest/c_TableAPI

Was this page helpful?