Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

set visible in variable set

tushar_ghadage
Tera Contributor

Hi Everyone, 

I have a requirement where on the catalog item, 

there are two custom fields in multi row variable set called select choice and application tag -

 

when a Type B is selected in choice field on the catalog form from choice field

field in the variable set select choice should be visible with the choice azure and on prem.

and only when on prem is selected another field called application tag should be visible (in variable set). 

 

I am new to variable sets can anyone help me out here please.

how shall I achieve this?

 

thanks!!

 

24 REPLIES 24

may be i have posted different script by mistake 

it was the same script 

but still its not working 

@tushar_ghadage 

then you are comparing wrong value, it should be type_b considering it's type_a, type_d

function onLoad() {
    //Type appropriate comment here, and begin script below

    var applicationType = g_service_catalog.parent.getValue("this_is_regarding");
    alert('applicationType' + applicationType);

    if (applicationType == 'type_b') // give the choice value to compare
        g_form.setDisplay('giveCorrectVariableNameHere', 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

here I am using exactly the same values as in the backend: 

here below is the backend value for  the select_choice :

Screenshot (125).png

below is regarding the type_b ,c,a and d values 

Screenshot (124).png

below is the script :

Screenshot (126).png

but still it's the same!! 

 

 

@tushar_ghadage 

share your PDI details if you are comfortable.

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

okay 

tusharsudhir.g@info.com

Snow@2024