The CreatorCon Call for Content is officially open! Get started here.

how to show/hide a variable set on change of selection of radio buttons (multiple choice type variable )? can someone help me with the script

Deepanshi Sood
Giga Expert

how to show/hide a variable set on change of selection of radio buttons (multiple choice type variable ) on a record producer? can someone help me with the script

Thanks in advance!

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Anshi 

You can have catalog client script onChange of that multiple choice variable

sample script below

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

if(newValue == 'your radio button value'){
g_form.setDisplay('variableSetName', false);
}

}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankush Jangle1
Kilo Guru

Hello,

 

write a onChange client script or Ui Policy.

 

ui policy:

 

check box field is true

 

make visibility of those fields true.

 

client script:

 

if (g_form.getValue('checkbox_field') =='true'){

 

g_form.setDisplay('variable_name',true);

 

else{

 

g_form.setDisplay('variable_name',true);

 

}

 

Please Mark it as Helpful/Correct if it Helps you

Pranesh072
Mega Sage

Ankur Bawiskar
Tera Patron
Tera Patron

@Anshi 

You can have catalog client script onChange of that multiple choice variable

sample script below

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

if(newValue == 'your radio button value'){
g_form.setDisplay('variableSetName', false);
}

}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Anshi 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader