- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 05:19 PM
I'm building a fairly simple REST app for ServiceNow. Using the REST API Explorer (great tool!) and some examples on here I've been able to connect and raise Incident records with all the field information I need.
The only thing I can't seem to wrap my head around is how to pick up the text label of an Incident State - I can get the integer from the Incident record and I understand there is a relationship set up within the Dictionary between each integer and a corresponding label. Eg. Incident State=1, Label is "New"
Maybe I'm wrong, but I would expect I can look up another table via REST, pull out the integers and retrieve my text statuses? I've tried accessing the Dictionary table in the API explorer but this doesn't go far enough...any help out there please?
My goal for this integration is to raise an incident or request, and then when required report back the status of said record - been doing my head in for days...
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2016 05:13 AM
I ended up getting the best (and simplest!) answer on my Stack Overflow question...
What you're looking for is a display value. You can set a query parameter using REST API Explorer named sysparm_display_value
.
Value options are:
- true returns display values for all of the fields.
- false returns actual values from the database. If a value is not specified, this parameter defaults to false.
- all returns both actual and display values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 09:53 PM
Hi Greg,
This post will help you.
How can get choice's label in JSON & REST
..
You can call the table sys_choice, name = tablename, element = field name and that will give you the Label of the field.
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2016 05:13 AM
I ended up getting the best (and simplest!) answer on my Stack Overflow question...
What you're looking for is a display value. You can set a query parameter using REST API Explorer named sysparm_display_value
.
Value options are:
- true returns display values for all of the fields.
- false returns actual values from the database. If a value is not specified, this parameter defaults to false.
- all returns both actual and display values.