Flow designer userid / email

kiwi07
Tera Contributor

I am trying yo create a flow and calling a action from the flow , i need to pass loggend in userID and email , i have tried custom script with gs.getUser() but that did not work , is there a way to achieve this

kiwi07_0-1676291966756.png

 

1 ACCEPTED SOLUTION

@kiwi07 

to get logged in userid and email use this

gs.getUserID()

gs.getUser().getRecord().getValue('email')

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Shree_G
Mega Sage

Hello,

 

Try Using gs.getUserName().

 

Hope this helps!


If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.

Ankur Bawiskar
Tera Patron
Tera Patron

@kiwi07 

your logged in user will depend on what your flow is configured to run as

Whether it's configured to Run as System or with logged in user?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

kiwi07
Tera Contributor

@Ankur Bawiskar it is configured to run with logged in user

@kiwi07 

to get logged in userid and email use this

gs.getUserID()

gs.getUser().getRecord().getValue('email')

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader