- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 05:15 AM
Hi folks,
How to get currently logged in user name and use it in condition in Action Rest step.
I added lookup record step, when sys_id is javascript:gs.getUserID() and as an output I used Name from User record data pill step.
Got error that no record was found.
but when I hardcoded sys_id I received what I expected
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 05:49 AM
Hi @miro2 ,
Your flow will run as system or one who initiate the session?
If Run as - System -> then gs.getUserID() won't help
If Run as -> User who initiates session -> then gs.getUserID() will help
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 05:49 AM
Hi @miro2 ,
Your flow will run as system or one who initiate the session?
If Run as - System -> then gs.getUserID() won't help
If Run as -> User who initiates session -> then gs.getUserID() will help
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 07:09 AM
Hi @Gunjan Kiratkar
works for flow if Run as -> User who initiates session