How to make a variable visible/invisible based on another variable.

ramandeep
Kilo Contributor

Dear Friends,

I have a Catalog Item. There i have one check box type variable(Let us say abc) and two date type variables(let us say mno and pqr). I want if abc variable is checked then mno and pqr variables should be visible otherwise these(mno and pqr) should remain invisible. Can you please tell how can I achieve that?

Thank you

Ramandeep

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Ramandeep,



With screenshots


Screen Shot 2015-09-04 at 3.43.35 PM.JPG


Screen Shot 2015-09-04 at 3.43.41 PM.JPG


View solution in original post

13 REPLIES 13

You Can use Catalog UI policy for this req.


Hi Pradeep,



Thank you for the update! As I mentioned I have created above catalog client script. It is working fine but I just want that when I open the Item mno and pqr variables should be invisible. I created "onChange" client script and it should run when I open Item but this is not happening.



Thank you


Ramandeep


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Ramandeep,



With screenshots


Screen Shot 2015-09-04 at 3.43.35 PM.JPG


Screen Shot 2015-09-04 at 3.43.41 PM.JPG


ok. I am creating this UI Policy now but I am afraid if it will hide mno and pqr when I open the item.


u have only created the client script right?


make ui policy like I said. it will work fine. those two fields will b inivisible when form loads.this what u want I guess.