- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2015 08:23 PM
Using table api with the following query
https://<site>/api/now/table/sys_choice?name=sometable&element=somecolumn
returns json
{
"result": [
{
"label": "High"
},
{
"label": "Medium"
},
//etc
]
}
How do you get the value column to be returned? I've tried "sysparm_display_value=all". I've tried "sysparm_fields=label,value". Nothing works...when I specify a column that exists on the sys_choice table that is not "label" i get empty results...the correct number of results, but all empty
{
"result": [
{},
{},
//etc
]
}
What i want is
{
"result": [
{
"label": "High",
"value": "1"
},
{
"label": "Medium",
"value": 2
},
//etc
]
}
Seems like a simple thing to do...can't seem to figure it out...when i query another table like incident with no filters or field specifications all the fields are dumped as expected...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2015 11:03 AM
This is happening due to an ACL issue, the user doesn't have the "personalize choices" role so they only data on the sys_choice table they can see is the label, to correct this apply the "personalize", "personalize choices", or "personalize response"s role to the user you are running the query with and they should be able to see the rest of the fields on the sys_choice table. Alternatively you could alter the ACL that allows for all fields to be read on the sys_choice table.
-JB

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2015 10:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2015 04:34 AM
I changed the role of the API user to include "Admin" and achieved no difference in results. Are there permissions per column? I can retrieve the label value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2015 05:04 AM
Don't think your query is right.
https://instance/api/now/table/sys_choice?sysparm_query=name=incident&element=state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2015 05:15 AM