Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Get User Details In SDK Custom UI Page

carmenwhitt
Tera Contributor

I've been trying to find a way to access the logged in user's details from a custom UI Page made in React using the ServiceNow SDK v4.0.2.

 

The only examples given have been using fetch requests to tables using the token retrieved from g_ck for authentication. I'm uncertain how to get this information given that I can't seem to access standard client-side objects, or call script includes from the custom UI Page.

 

I feel like I'm just missing something here if anyone knows how to accomplish this, a hint would be super appreciated.

1 ACCEPTED SOLUTION

BryceG
ServiceNow Employee
ServiceNow Employee

Have you tried this api?

api/now/ui/user/current_user

 

View solution in original post

3 REPLIES 3

BryceG
ServiceNow Employee
ServiceNow Employee

Have you tried this api?

api/now/ui/user/current_user

 

Thank you so much Bryce, I don't know how I missed that. 

 

I'll be sure to ask the members of my team that are more experienced with the REST API first next time!

I wonder if there are other methods here that can be use din the cleint part of a react app? Is there any documentation of that api?