Help with Catalog Client Script

Jen11
Tera Expert

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. 

 

Jen11_0-1739574152856.png

 

Thank you in advance for any help. 

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Jen11 

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