Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Get current username of logged in user

ankul
Tera Contributor

Hello Everyone,

I want current username of logged in user through Glide System.

Regards

Ankul

6 REPLIES 6

Vaishnavi Lathk
Mega Sage
Mega Sage
 
Hey
 
getUserName() is the method of glide system used to find current logged in user's name. Below is the link of service-now wiki where u can find all the methods of glide system. Returns a reference to the User object for the current user.
 
 

salma98
Tera Contributor

Use gs.getUserName() to get  current logged in username. You can put this as query in GlideRecord as


ga.addQuery('user_name',gs.getUserName());