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.

Catalog Item lookup and display read only information about a user

phil34
Tera Expert

Hi All,

This is probably quite simple but I cant seem to figure it out.

I have a use case for a service catalog/service portal item. When the form loads is will be blank as pictured and when the person selects a user in the employee name field I want the read only fields to display the data about the employee. If the user changes the value in the employee name field then I want the read only data to instantly change to the newly selected employee's information. I hope the screenshot and help annotations assist to describe what I trying to do.

The employee name field is a reference field to the sys_user table and the other two are single line of text fields should they be reference fields too?

find_real_file.png

 

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Phil, I think you can switch it to the reference field (read only) and set those dynamic values via reference qualifier.

https://docs.servicenow.com/en-US/bundle/sandiego-platform-administration/page/script/server-scripti...

 

- Pradeep Sharma

Hi Pradeep,

I think your solution might return an array or multiple options, I am looking to populate those fields with static values already in the other tables. I have managed to get it to work on the location field so far by using a Catalog Client Script as per below but now I am stuck on getting the Division to do the same thing. PS I did change both fields to be reference fields now and both of them reference the location cmn_location table. Any help is appreciated.

Thanks

find_real_file.png

find_real_file.png

Now I need this one in the division field on my form

find_real_file.png

find_real_file.png

Hi Pradeep,

Can you explain a bit more about your suggestion, I am new at Service Now and trying to learn.

Thanks Phil