Print full row of table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 03:55 PM
Hi,
Is it possible to print full row of table in ServiceNow ?
For example :
Instead of getting First Name , Last Name etc like below :
var gr = new GlideRecord('sys_user');
gr.get('email','user@gmail.com');
gs.print('FirstName'+gr.first_name);
Is it possible to get complete detail of user( full row) from table
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:24 PM
Thanks so much for replying!
Please also let me know if there is any inbuilt method like in Glidesystem ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:39 PM
Hi Sneha,
Generally, when you do GlideRecord() it gives you result based on the matching condition. You may find more functionality here : http://wiki.servicenow.com/index.php?title=GlideRecord#gsc.tab=0
Also, you should avoid getting complete row/all field values because in most of the tables have reference fields which are referring to some other table so you need to use dotwalk to get related values : ie: gr.location.city
Location is referenced table here
I would say, instead of trying to get all attributes, you should only access those field which you really want.
I hope this help.
Let me know in-case of any query.