- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2022 09:29 PM
Hello.
I need to retrieve some record information from several tables using ServiceNow's REST API and use it outside of ServiceNow.
Is this possible with a single REST API call?
Can someone please share with me the best practices to make this possible using ServiceNow's REST API?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 12:27 AM
Hi,
Is the aim to import data into ServiceNow?
There is 2 approaches. The first is to export ServiceNow's master table to external service and have the external service specify ServiceNow's sys_id.
The second approach is to to import keys used by the external services into ServiceNow. ServiceNow has "correlation id" and "correlation display" to hold keys and description used by external services. Correlation id may be used to match the records when importing data ('remote correlation ID' in the following page).
ServiceNow's integration hub is using the 2nd approach. That is, instead of exporting sys_ids, import keys used in external service into ServiceNow. Keeping the "single source of truth" on ServiceNow is the recommended way.
Which approach to take will depends on where job scheduling is to be done. It's better to keep job scheduling in 1 place so lessen cost and time of operation.
If taking the 1st approach, table APIs will suffice.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 12:27 AM
Hi,
Is the aim to import data into ServiceNow?
There is 2 approaches. The first is to export ServiceNow's master table to external service and have the external service specify ServiceNow's sys_id.
The second approach is to to import keys used by the external services into ServiceNow. ServiceNow has "correlation id" and "correlation display" to hold keys and description used by external services. Correlation id may be used to match the records when importing data ('remote correlation ID' in the following page).
ServiceNow's integration hub is using the 2nd approach. That is, instead of exporting sys_ids, import keys used in external service into ServiceNow. Keeping the "single source of truth" on ServiceNow is the recommended way.
Which approach to take will depends on where job scheduling is to be done. It's better to keep job scheduling in 1 place so lessen cost and time of operation.
If taking the 1st approach, table APIs will suffice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 03:11 AM
Thank you very much.
I think the direction I was thinking of is closer to the first method, but...
The value specified by the user using the external service should not be the sys_id, but the display value.
I would like to use the internal processing of the program to obtain the sys_id corresponding to the display value entered by the user and register the record containing that sys_id in the ServiceNow table.
Is this considered inappropriate?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2022 08:10 PM
If the display value is unique, there's no need to export the master files.
Either import to an import set table and use transformation map to map display value to sys_id or create a Scripted REST API to do the transformation on POST and PUT.
If many records are going to be inserted at once, I'll recommend using import sets but it's just few records, recommend creating a Scripted REST API.