sysparm_fields to get all the fields along with display value of reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 02:14 PM
How to get all the fields in the table along with display value for few of the columns
is it possible to get something like "sysparm_fields=*, team_leader.employee_number"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 01:47 PM
I m using the sysparm_fields as part of the REST API GET query in my c# code..
its something like https://xxx.service-now.com/api/now/table/x_opt_macro_team_leader?sysparm_fields=*, team_leader.employee_number?
but this one not fetching any columns

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 01:56 PM
Use this
var dict = new GlideRecord('sys_dictionary');
dict.addQuery('name','change_request');
dict.query();
var fieldnames='';
while(dict.next())
{
if (fieldnames =='')
fieldnames = dict.element;
else
fieldnames = fieldnames+','+dict.element;
}
Please mark this response as correct or helpful if it assisted you with your question.