Help with Catalog Client Script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 03:03 PM
I need help with a catalog client script. For the ''Operational work type' drop down, whatever that is selected there, I would like the 'Work category' drop down to to change to the same thing. The choices for both the drop down are the same, but the value is different.
Thank you in advance for any help.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2025 06:39 AM
if the label is same but choice value is different then you will have to use if else in your onChange of 1st field
something like this
function onChange(control, oldValue, newValue, isLoading) {
if (!isLoading || newValue == '') {
return;
}
if (newValue == 'ABC')
g_form.setValue('field2', 'yourChoiceValue1');
else if (newValue == 'DEF')
g_form.setValue('field2', 'yourChoiceValue2');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader