How to hide variable from a catalog if it is used in variable set for other catalogs

vinitaraico
Tera Contributor

Hi Team,

 

I have one variable and some drop down which is configure in variable set and used by 3 catalogs ,I need to hide it in Once catalog Kindly let me know How i can achieve it

 

 

1 ACCEPTED SOLUTION

Yashsvi
Kilo Sage

Hi @vinitaraico,

 

Go to Service Catalog > Catalog Definitions > Maintain Items.

Open the catalog item where you want to hide the variable.

Navigate to the Catalog Client Scripts related list and click New.

Set the Type to onLoad.

 

function onLoad() {
    g_form.setDisplay('variable_name', false);  // Replace 'variable_name' with the name of your variable
}

 

Thank you, please make helpful if you accept the solution.

View solution in original post

2 REPLIES 2

Ramjee
Tera Expert

Hi @vinitaraico 

OK, we figured it out.  We had to take the "negative" approach rather than the "positive" one to do it.  So in the first Variable Set, we would need to set up the Catalog Client Script like this:

Catalog Conditions: Field A2 is NOT "Other"

Reverse if False: Checked

Catalog UI Policies Actions:

Variable Name: Field A3

Mandatory: False

Visible: False

Clear the variable value: Checked

Yashsvi
Kilo Sage

Hi @vinitaraico,

 

Go to Service Catalog > Catalog Definitions > Maintain Items.

Open the catalog item where you want to hide the variable.

Navigate to the Catalog Client Scripts related list and click New.

Set the Type to onLoad.

 

function onLoad() {
    g_form.setDisplay('variable_name', false);  // Replace 'variable_name' with the name of your variable
}

 

Thank you, please make helpful if you accept the solution.