The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How do i hide variables on a catalog item depending on a selection of another variable.

abcmh
Giga Contributor

I have a Service Catalog item that i am working on . I am adding variables to this item which are checkboxes, radio buttons, multivalue drop down selections, text values, date items etc.

If i select a particular check box like "New Contract" , i need to display a couple of date variables and a comments variable.

What is the best way to achieve this ? Any suggestions?

Thanks,

31 REPLIES 31

Please mark this as correct and helpful if it resolve your query. So that this thread could be marked as answered.



Please refer the ink below.



How To Mark Answers Correct From Community Inbox


Madhu27
Tera Expert

This can be accomplish this by using UI-policies.



1. Create a new UI-policy


2. Specify the conditions


3. Create new UI Policy Actions (specify Mandatory/Visible/Read only)



find_real_file.png



find_real_file.png


For more info ...http://wiki.servicenow.com/index.php?title=Service_Catalog_UI_Policy#gsc.tab=0




Thanks


Madhu



PS: Hit   Like/Helpful   if it helps


one thing to add to this...



UI policies are by far the best method of hiding a variable on a catalog item... if you ARE hiding a varaible it is a REALLY good idea to check the run scripts box.. and in in the
"execute if false" block put in a script to clear the value from the field you are hiding   IE "g_form.clearValue('variableName');



this way if the variable is taken off the form AFTER they have filled it in the value gets cleared out <users do silly things>


Hi madhu garu  i need to populate the variable fields like one is visible and one is hidden by using   

on-change client script. can u suggest ..

 

abcmh
Giga Contributor

Thanks for everyone's input . I have tried the suggestions but haven't been able to achieve the desired result.


So here is what i have done.



I have a checkbox item called "New Contract". If i check "New Contract" then i want to Contract Start Date , End Date and Comments fields to display.


If its unchecked the 3 fields should be hidden.



So i created a new Catalog UI Policy for the "New Contract" item with then Condition as it should be True.


Then i created a New UI Policy actions for the 3 items Contract Start Date, End Date and Comments. All the 3 were set to


Mandatory - True , Visible - True & Read Only - Read Alone.



However when i TryIt and the 3 fields are displayed all the time where as i just want to display them when i check the "New COntract" check box.


What am i doing wrong?