Print full row of table

Sneha39
Mega Guru

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

6 REPLIES 6

Sneha39
Mega Guru

@sachin.namjoshi


@chirag.bagdai



Thanks so much for replying!



Please also let me know if there is any inbuilt method like in Glidesystem ?


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.