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

How do I hide variables on a form activated by an UI Policy?

ravi_otpp
Tera Expert

Hi everyone,

 

Wondering if someone could shed some light on a small issue I'm having with UI Policies.

 

I've created a couple of different UI Policies on a form which effectively display and hide other variables (fields) based on the conditions already selected. However, if a requester went through one selection which then causes a bunch of fields to appear (as designed) and then changed their mind and went back to the original drop-down selection and changed it (which should then only show one variable) it doesn't. It instead still shows fields activated by the previous selection path.

 

Is there a way of stating to only show the respective variable if an item is selected and hide or remove all previous fields shown on a form? Essentially, wiping the slate clean?

 

Thanks,

 

Ravi

1 ACCEPTED SOLUTION

domaners
Kilo Guru

I had a similar problem with a large Record Producer I created in the past. I'm guessing you have setup something like this:



Question 1 (Choices A, B)


        Question 2 (Choices D, E, F) *Appears when A is selected on Q1.


                  Question 4 *Appears when D is selected in Question 2


        Question 3 (Choices G,H, I) * Appears when B is selected on Q1



So, to get Question 4 to appear, the user would have to select A in Question 1, then D in question 2. This is fine until the user changes their mind and selects B on Question 1. Question 2 would hide and Question 3 would show, which is correct, however Question 4 would stay displayed as the only condition in the UI Policy is "Question 2 == D". Question 2 still holds D as a value even though it is hidden, so what we should really be saying in the UI Policy is "Question 2 == D AND Question 1 == A".



That was a bit of a mouthful to explain, but I think it will solve your problem, as you just need to add the conditions going back to the top level question to ensure that your fields hide and display correctly. Let me know if this needs further explanation!


View solution in original post

5 REPLIES 5

Jamie_douglas
Giga Expert

Hi Ravi,



Have you got the 'reverse if false" option ticked.. This should reverse the actions if the conditions no longer match.


Kalaiarasan Pus
Giga Sage

if you are using ui policy + ui policy action, 'reverse if false' will help... if you are using script in ui policy, writing the reverse logic code in 'execute if false' will help....


domaners
Kilo Guru

I had a similar problem with a large Record Producer I created in the past. I'm guessing you have setup something like this:



Question 1 (Choices A, B)


        Question 2 (Choices D, E, F) *Appears when A is selected on Q1.


                  Question 4 *Appears when D is selected in Question 2


        Question 3 (Choices G,H, I) * Appears when B is selected on Q1



So, to get Question 4 to appear, the user would have to select A in Question 1, then D in question 2. This is fine until the user changes their mind and selects B on Question 1. Question 2 would hide and Question 3 would show, which is correct, however Question 4 would stay displayed as the only condition in the UI Policy is "Question 2 == D". Question 2 still holds D as a value even though it is hidden, so what we should really be saying in the UI Policy is "Question 2 == D AND Question 1 == A".



That was a bit of a mouthful to explain, but I think it will solve your problem, as you just need to add the conditions going back to the top level question to ensure that your fields hide and display correctly. Let me know if this needs further explanation!


Thanks a lot Adam, that was the fix! For some reason, I thought that simply stating "Question 2 == D" would be enough since it would just check for that condition. But, thinking of it again it makes sense that this would confuse things, especially since I'm working with two different logical paths.



Ravi