Show variable based on Assignment group in a catalog task

NiSaraswat
Tera Contributor

Hi,

 

I need to show Variable Categories only the assignment group changes to Support L2.

 

If assignment group is anything else except Support L2 it should not show the Variable Categories.

 

Variable Categories will be visible only on task when Assignment group is Support L2

 

Can anyone please help to achieve this.

 

Thank You!

10 REPLIES 10

RaghavSh
Kilo Patron

what are variable categories? Is your variable a reference field and you want to show some other values from that table?


Raghav
MVP 2023

Ankur Bawiskar
Tera Patron
Tera Patron

@NiSaraswat 

you can write onChange normal client script on sc_task table

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading) {
        return;
    }

    if (newValue == 'L2 Support Group SysId')
        g_form.setDisplay('variables.variableName', true);
    else
        g_form.setDisplay('variables.variableName', false);

}

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

somehow its not working.

@NiSaraswat 

what didn't work?

what debugging did you do?

I informed to create normal client script and not catalog client script.

share what alert came?

did you use correct group sysId?

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

what didn't work?

When i changed the assignment group to Support L2, it still did not show the Variable.

what debugging did you do? 

I informed to create normal client script and not catalog client script.
tried doing client script normal

share what alert came? no alert came

did you use correct group sysId? yes