Using REST without sysIDs?

toneyvecchio1
Tera Expert

If an external platform is going to use REST to post into any record, say Incident, it looks like they have to have the sysIDs to populate any reference fields. Can this be accomplished if they don't have the sysIDs but instead will be sending a display value or any other mutually agreed key?

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Toney,



You can do this by using the import set API rather than the direct table API. This allows you to use a transform map (and scripts if needed) to manipulate the data before it hits the target table. Worst cast, you can use the setDisplayValue() method to have the system do a lookup/match on the display value to turn it in to a sys_id for that reference field.


Example:



target.assignment_group.setDisplayValue(source.groupName);



Getting Started with REST - ServiceNow Wiki


REST API Explorer - ServiceNow Wiki


REST API



Create a transform map  


View solution in original post

2 REPLIES 2

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Toney,



You can do this by using the import set API rather than the direct table API. This allows you to use a transform map (and scripts if needed) to manipulate the data before it hits the target table. Worst cast, you can use the setDisplayValue() method to have the system do a lookup/match on the display value to turn it in to a sys_id for that reference field.


Example:



target.assignment_group.setDisplayValue(source.groupName);



Getting Started with REST - ServiceNow Wiki


REST API Explorer - ServiceNow Wiki


REST API



Create a transform map  


Pradeep with the score, that exactly what I was trying to find, Inbound Webservices with a Transform Map. Thanks!!