TABLE API : query over multiple tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2018 06:52 AM
Hi,
I'm using the table api to get to retreive some information.
Something like;
.../api/now/table/u_responsibilities?sysparm_query=u_related_to.company=dc01d2a0a0a280a00c2bd3065d88de
A part of the XML-output look like ;
<u_email>xxxxx@***.***</u_email>
<sys_mod_count>0</sys_mod_count>
<u_alternate_phone>+316125879784</u_alternate_phone>
<sys_updated_on>2017-10-25 14:37:40</sys_updated_on>
<sys_tags/>
<u_business_phone>+316125879784</u_business_phone>
<u_user>
<link>
https://kpn.service-now.com/api/now/table/sys_user/b3a69e360a0a280a008f134eb04de8ef
</link>
<value>b3a69e360a0a280a008f134eb04de8ef</value>
</u_user>
https://kpn.service-now.com/api/now/table/sys_user/b3a69e360a0a280a008f134eb04de8ef

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2018 04:35 PM
Hello Paul,
You can append sysparm_display_value=true to the Table API to fetch the reference field display value i.e query should be something like.
.../api/now/table/u_responsibilities?sysparm_query=u_related_to.company=dc01d2a0a0a280a00c2bd3065d88de&sysparm_display_value=true
Thanks,
Pradeep Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2018 04:51 PM
Hi
You can dot-walk to fields on related referenced records if you include sysparm_fields in your URL, e.g. u_user.user_name
The only downside is that if you introduce sysparm_fields into your URL you will need to specify all the fields you want to return, in a comma separated list, so let's say you want all of those fields that are shown in your output snippet your URL would look something like this:
.../api/now/table/u_responsibilities?sysparm_query=u_related_to.company%3Ddc01d2a0a0a280a00c2bd3065d88de&sysparm_fields=u_email,sys_mod_count,u_alternative_phonee,sys_updated_on,u_business_phone,u_user.user_name,value
Regards
Bonnie
PS - Please mark as Helpful or Answered if this has helped or answered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2021 06:33 AM
Thanks! This saved me lots of time trying to figure out how to write some complicated code in the client controller of a widget. Dot walking to the other table I need the data returned from worked great.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2018 11:15 PM
Thanks for the respons.
I'll try both options