using a Client Script

AdithyanS
Giga Contributor

There are two fields, Requested For and Manager, in two separate application tables. When I select a user in the Requested For field, the Manager field should automatically populate with that user's manager and become read-only. How can I implement this in ServiceNow using a Client Script?

1 ACCEPTED SOLUTION

Tanushree Maiti
Tera Patron

 

Hi @AdithyanS 

 

You can use an onChange Client Script on the Requested for field along with GlideAjax, passing the selected Requested for user's value to a Script Include. In the Script Include, you can use GlideRecord to retrieve the manager from the relevant table based on the selected user and return the result to the Client Script.

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

View solution in original post

1 REPLY 1

Tanushree Maiti
Tera Patron

 

Hi @AdithyanS 

 

You can use an onChange Client Script on the Requested for field along with GlideAjax, passing the selected Requested for user's value to a Script Include. In the Script Include, you can use GlideRecord to retrieve the manager from the relevant table based on the selected user and return the result to the Client Script.

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti