We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to retrieve display value of document id field type from the table API

Raskill1
Giga Contributor

Hi experts,

I am trying to hit the table api end point, https://instance.service-now.com/api/now/v2/table/sysapproval_approver?sysparm_query=state%3Drequested&sysparm_display_value=true&sysparm_limit=100

to fetch data of the sysapproval_approver table. The issue that I am facing currently is that for the document id field type fields like sysapproval and document_id retrieve empty values for it even when the sysparm_display_value=true.

Sample JSON response,

"result": [
        {
            "register_name": "",
            "u_auto_closed": "false",
            "sysapproval": {
                "display_value": "",
                "link": "https://instance.service-now.com/api/now/v2/table/task/67fd95fe6f540e001440523e5d3ee464"
            },
            "document_id": {
                "display_value": "",
                "link": "https://instance.service-now.com/api/now/v2/table/sc_request/67fd95fe6f540e001440523e5d3ee464"
            },
            "approver": {
                "display_value": "Amber Test",
                "link": "https://instance.service-now.com/api/now/v2/table/sys_user/5afe8db90f525640ae865d78a1050e45"
            }
 
However, the reference field on the sys_user fetches the display value appropriately. How can I get the correct display values for the sysapproval and document_id fields.
 
Any help on this is highly appreciated!
 
Thanks,
Raskill
2 REPLIES 2

Chuck Tomasi
Tera Patron

That feels like a bug. I would expect it to show what it does on the form. Ex: Incident:INC0010001

Noah Drew
ServiceNow Employee

Hi Raskill!

Is this happening on other tables as well or just for sysapproval_approver?

Is the endpoint being accessed as an Admin?

Hope that helps!

If it did, please mark as Helpful and consider setting this reply as the Correct Answer to this question, thanks!