Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

How to get current logged in user in server side and client side?

ak4
Tera Contributor

How to get current logged in user in server side and client side?

 

5 REPLIES 5

Kunal Varkhede
Tera Guru

sriram35
Mega Guru

Hi,

 

Client-Side:

 

g_user.userID

 

 

Server-side:

 

gs.getUserID();

 

 

 

Hope this helps!

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Sriram

Ankur Bawiskar
Tera Patron

Hi,

please find below lines

client script: g_user.userID

Server side: gs.getUserID()

Regards
Ankur

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

@Ankur Bawiskar  How do I get a current logged in user's Primary Group?

I have tried a below script but it is not working

var priGrp = gs.getUserID().getRecord().getDisplayValue('primary_group');

Primary Group is Reference field.