Get current username of logged in user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2016 09:39 PM
Hello Everyone,
I want current username of logged in user through Glide System.
Regards
Ankul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2016 09:48 PM
Hi Ankul,
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.
http://wiki.servicenow.com/?title=GlideSystem#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2016 09:51 PM
you can use gs.getUserName()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2016 09:53 PM
Hi Ankul,
Use gs.getUserName() to return you current logged in username. You can put this as query in GlideRecord as
ga.addQuery('user_name',gs.getUserName());
Thanks,
Mrudula

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2016 01:43 AM
Hi,
Use gs.getUserName();
getUser() | Returns a reference to the User object for the current user. More information is available here. |
getUserDisplayName() | Returns the name field of the current user (e.g. John Smith, as opposed to smith). |
getUserID() | Returns the sys_id of the current user. |
getUserName() | Returns the username of the current user (for example, jsmith). |
refer GlideSystem - ServiceNow Wiki
-Giri