how to get current logged in user and date and time in service now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @divyareddyp2,
please provide more details.
Because it will depend on location where you want to get it...
For example currently logged in user:
- in portal (frontend) > g_user.userName;
- e.g. catalog client script
- in backend (backend) > gs.getUserID();
- e.g. business rule
And for the date and time, please refer to GlideDateTime, GlideDateTime - Global or Glide Server APIs
Thank you for accepting my solution.
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @divyareddyp2,
do you have any details? Please review my response above.
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @divyareddyp2 ,
Can you specify where you want to pick these value - On form (Client), In any Business Rule , Scriopt include (Server side). As current logged in user in client script can be found using g_user class's method while on backend you can use Glide system class's Methods.
Regards,
Nikhil Bajaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
where you want -> client or server side?
what's your business requirement?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader