The CreatorCon Call for Content is officially open! Get started here.

About the GET method of the Table API

Koki
Tera Contributor

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?

1 ACCEPTED SOLUTION

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).

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/integrationhub/concept...

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.

View solution in original post

7 REPLIES 7

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).

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/integrationhub/concept...

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.

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?

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.