Should I use the external ID for a retrieved record or allow ServiceNow to assign it?

HedgeHodge
Tera Contributor

When pulling data from an external API, should I utilize the unique ID from the external records as the primary ID within ServiceNow or should I allow ServiceNow to assign a unique ID.

I want to maintain referential integrity for the various tables I will be retrieving.

5 REPLIES 5

John Zhang1
Kilo Patron
Kilo Patron

If you import the external data into ServiceNow (SOW), the unique ID will be generated from ServiceNow for each external record.  SOW ID will keep data integrity across all database tables.   I recommend you use SOW ID.

If you like to reference to the external record in external system, you can keep your external ID in your SOW record.

 

If my reply is Helpful/Correct, please mark the answer as Helpful/Correct. 

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi HedgeHodge,

ServiceNow will auto-assign an internal id called sys_id when inserting a record. If there is a need to maintain referential integrity among tables imported from external API, create a new field for the external ID and use that as a key to map sys_id among tables in ServiceNow when importing data.

Richard Hine
Tera Guru
Tera Guru

As others have said, let SN allocate its ID, if you need to store the external system reference in the SN record then look to see if the record you are going to populate has a field such as correlation_id to store it in.

Richard

Make use of correlation_id as mentioned by Richard to store that. Let sys_id be as is, maintained by platform,