- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:37 AM
Hi All,
Can someone please help me with the catalog client script?
I have two field
1) select_the_type_of_access_required
2) u_description
I need an on change catalog item script
when I select the "type of access" the description should auto fill itself.
Custom table name " u_Azure_role
I have something in place but it wont work 😞
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:52 AM
Hello @Thomas98 ,
Is select_the_type_of_access_requireds a reference field?
If so, replace
g_form.setValue('description',u_azure_roles.u_description);
with
g_form.setValue('description',user.u_description);
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 10:53 PM
Hello @Thomas98
You have to use Script Include Call using client script-
Please open the above link and complete your requirement.
Please mark correct answer and helpful for others if it helps you
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 06:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 11:56 AM
Hi,
user the user object in place of custom table name because you are taking that object as input parameter in populateDetails function.
g_form.setValue('description', user.u_description);
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 10:15 PM
Hello @Thomas98 if your Servicenow is on Utah version and above you don't need client script to achieve this. You can use autoPopulate feature, check example below
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 10:33 PM
Hi Harish, Yes, it will help. However, it will still be applicable only for Reference not for Lookup Select box.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 10:38 PM
I tot it's a reference field.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 10:48 PM
getReference I believe won't work with lookup select box
Please use GlideAjax
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader