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
09-03-2025 10:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2025 07:42 AM
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
09-08-2025 05:02 AM
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
09-04-2025 07:46 AM - edited 09-04-2025 07:46 AM
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
ServiceNow Rising Star-2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2025 07:51 AM
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