- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 06:40 AM
Hi,
I'm new to service now so and I'm having some issues in getting the reference values for the display values.
I'm trying to create some incidents using the REST api and I want to populate the assignment group fields from the third party tool creating the tickets. Since it's a reference field, if I send the value it shows up as a reference and not as a display value.
Is there a way to either send the Display value and not the reference value or to get a complete list of values for that particular field and do a look up before sending the values??
Thanks and any help is much appreciated.
Regards,
Karan
Solved! Go to Solution.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 07:11 AM
Hi Karen,
I agree with Chuck. Best practice is to use an Inbound Web Service Import Set. Then you can send the display values and they will be automatically mapped to the correct sys_id.
I also recommend making use of the REST API Explorer. It has been an invaluable tool with all the REST integrations I have done. You can see in the Explorer that there is a parameter, called sysparm_input_display_value, you can add which will allow you to pass display values into reference fields. Use this if you need to POST directly into a table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 06:45 AM
Hi Karan,
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 07:11 AM
Hi Karen,
I agree with Chuck. Best practice is to use an Inbound Web Service Import Set. Then you can send the display values and they will be automatically mapped to the correct sys_id.
I also recommend making use of the REST API Explorer. It has been an invaluable tool with all the REST integrations I have done. You can see in the Explorer that there is a parameter, called sysparm_input_display_value, you can add which will allow you to pass display values into reference fields. Use this if you need to POST directly into a table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 07:32 AM
Thanks Geoffrey!!!
That was exactly what I needed!