sysparm_fields to get all the fields along with display value of reference field

kailashthiyagar
Kilo Guru

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"?

6 REPLIES 6

sanjivmeher



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


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.