The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get logged in user information in client script

Rajanmehta
Mega Guru

Hello,

We are on NewYork version. I have a need to find out about logged in user field value on client script (on INC table).

How can I get that information? Below is the custom field value I need in client script. (Service Type) 

I am able to get user Id, but nothing beyond that. 

Please advise.

Thanks,

find_real_file.png

 

Client Script on INC table.

find_real_file.png

 

 

1 ACCEPTED SOLUTION

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

You don't have access to everything about the user client side.  Given your script is an onLoad, you may be better off using a display business rule to set a g_scratchpad variable and utilizing that in your onLoad script. See the following article for an example:

https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/app-store/good_practices/client_s...

View solution in original post

6 REPLIES 6

Prateek kumar
Mega Sage

Check this out

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


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Thanks Prateek,

 

For providing the summarized document.

Thanks,

Rajan 

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

You don't have access to everything about the user client side.  Given your script is an onLoad, you may be better off using a display business rule to set a g_scratchpad variable and utilizing that in your onLoad script. See the following article for an example:

https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/app-store/good_practices/client_s...

Hi Michael,

Thanks that seems to be right approach for the solution.

Thanks,

Rajan