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-22-2017 06:18 PM
I believe getting display value is all or nothing, and you can't do it for only some fields using the OOB table APIs.
also, there may be performance concerns with pulling display values for every field in the table. I would recommend choosing precisely which fields you want and pull those only.
getting display values for reference fields have an extra glide record query, which is where some of the performance concerns come from.
and yes, you can dot-walk on the sysparm_fields parameter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 10:21 AM
My requirement, i would like to all the fields in my table, and display value for only one field..
i thought we can use something similar to it "sysparm_fields=*, team_leader.employee_number"?
I can mention all the fields in the sysparm_fields but the query will become too long since i have lot of fields.
Any recommendations?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 12:22 PM
sanjivmeher any thoughts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 01:33 PM
You can try using a for loop to build the comma separated field names.
For example if the table name is abc, you can use
var dict = new GlideRecord('sys_dictionary');
dict.addQuery('name','abc');
dict.query();
var fieldnames='';
while(dict.next())
{
if (fieldnames =='')
fieldnames = dict.element;
else
fieldnames = ','+dict.element;
}
var myquery= 'sysparm_fields='+fieldnames;
Not sure, if this is what you were looking for.
Please mark this response as correct or helpful if it assisted you with your question.