The CreatorCon Call for Content is officially open! Get started here.

Table API retrieve options

rob24
Kilo Explorer

Hi,

Just started using the Table API on Eureka and have encountered some challenges.   We are trying to use the task table rather than multiple dips to incident, problem, change etc. tables and need to obviously filter/limit the amount of returned data (so it's not overwhelming).

sysparm_exclude_reference_link works well in reducing the verbose link key/values from the response.   sysparm_fields allows us to specify what columns get returned but appears only to return the value.   Certain fields it seems have information stored in the display_value key, such as location.   When we specify sysparm_fields, all we get back is location: "" (empty).   Thus it appears the only way to get the location display information in the task record is to set sysparm_display_value to true which appears to conflict with setting sysparm_fields.

Is there any way with a single API call to retrieve the records from the task table, with the location field containing what was in the display_value rather than value.   Ideally we want to be able to get all the information we need to display the record without having to include all the unwanted information (like reference links) but still see information such as location.display_value.

Any help greatly appreciated.

Rob

1 ACCEPTED SOLUTION

andrew_venables
ServiceNow Employee
ServiceNow Employee

One of the best things about the new Table API is that you can request "dot walked" fields,



Try this:


https://instancename.service-now.com/api/now/v1/table/task?sysparm_fields=number,location,location.n...


View solution in original post

4 REPLIES 4

andrew_venables
ServiceNow Employee
ServiceNow Employee

One of the best things about the new Table API is that you can request "dot walked" fields,



Try this:


https://instancename.service-now.com/api/now/v1/table/task?sysparm_fields=number,location,location.n...


rob24
Kilo Explorer

Andrew,



Thanks for your prompt response.   Works perfectly.   This is a great capability as it allows effectively any field in the cnm_location to be retrieved in the same call (like location.latitude, location.longitude).



Cheers


Rob


Jerry Flood
Mega Contributor

Trying to search on reference links: tried sysparm_query=ref.sys_id=... or sysparm_query=ref.value=...

Trying to find all of the 'children' of a given sys_id through references to it.

 

Thanks

Jerry

Found an answer here, I think 

https://community.servicenow.com/community?id=community_question&sys_id=d3d5cb21db1cdbc01dcaf3231f96198b&view_source=searchResult