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.

gs.getUser() dotwalking in catalog item variable

Sascha1
Mega Contributor

Hello Everyone!

I am trying to use dotwalking to set default values for several catalog variables. Somehow it sometimes works the way I do it and sometimes it does not.

find_real_file.png

This way it worked for the Requester and the email address. The other values are still empty (although they are not empty in sys_user table)

In some cases (with some users) I get at least a sys_id in the location field. So I changed the variable type

find_real_file.png

the result is more or less the same with the difference that I get a valid location for some users now.

The following screenshot shows the form from the view of 2 different users (both have all fields filled in sys_user table). You can see that sometimes at least some fields are filled, but still not all of them.

find_real_file.png

 

I hope someone can show me what I am missing.

btw I tried to user gs.getUser().getLocation() (didnt work out) and gs.getUser().getRecord().getValue(‘phone’); (didnt work out either)

 

BR
Sascha

1 ACCEPTED SOLUTION

Sri Harsha3
Tera Expert

You mean for some users the gs.getUser().getRecord().getValue('department'); is working for few it is not. Have you checked the permissions of the fields?

View solution in original post

6 REPLIES 6

Sri Harsha3
Tera Expert

You mean for some users the gs.getUser().getRecord().getValue('department'); is working for few it is not. Have you checked the permissions of the fields?

Sascha1
Mega Contributor

Thank you for your numerous answers. Basically a mix of all of the answers was very helpful. I was able to use some of the functionalities from User Object Cheat Sheet

 

For some info that did not display I needed to add permissions.

 

Thank you all for your help!