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

Hi Rushil,



I deleted the client script and used only the UI Policy as shared by Pradeep and it only working fine.



Thank you for the help!


Ramandeep


hi ramandeep,



yes that is much better way. I also did not realize that it will hide the fields automatically.



thanks,


Rushit patel


Hi Pradeep,



Yes it is working fine. Thank you very much! Can you please tell how it is hiding these 2 fields when I open the Item?



Thanks


Ramandeep


Hi Ramdeep,



UI policy runs on load so the actions are taken as per the conditions.




Link for Ui policy:


Creating a UI Policy - ServiceNow Wiki