Get email, phone.... from current logged in user , does anybody know ?

Pastupe
Mega Guru

Hi all,
I spent some time to find how get data about logged in user and dont have luck.
I want get whatever exist on sys_user table from user record.
I can get it from form to state = current.assigned_to.email
But how do I get same info from logged in user ?

gs.getUser(); dont work for me

i tried gs.getUser().email; .......and not work
I need to use this in

Please help
Petr

8 REPLIES 8

Mark Stanger wrote:



I'm glad the guru page helped. If you're getting user values server-side, there's a shortcut to all of the information that is explained there. Here's a code example for getting the user's title.


  1. //This script gets the user's title  
  2. gs.getUser().getRecord().getValue('title');  



I know this is an old thread but your answer helped me out! All i had to do was look in the sys_user table for the coulm names and it worked. Thanks!


Mark Stanger
Giga Sage

The method for getting the user data depends on where you're trying to get the user data from. You can use the SNGuru user object cheat sheet as a quick reference.

http://www.servicenowguru.com/scripting/user-object-cheat-sheet/


Thanks a lot for this SN guru page. I like it!
Petr


gangarawat
Giga Contributor

gs.print(gs.getUser().getEmail());