UI Policy not working properly

rafaelalves4337
Tera Contributor

Team,

 

I have a simple form with 5 selections, each one show and hide different variables, it's all working fine, but I do have another ui policy inside one if the options for a YES/NO question, if the user select YES it will show a new variable, is select no it will hide, it works fine too, the problem is, if i select NO and change my first selection, to a new option, when i return to the previous option, that variable appears even with NO selected.

 

UI policy working good here:

Screenshot_4.png

 

This is when I change the options in the menu and return to the previous one in the form:

Screenshot_3.png

 

I created this script trying to force the selection to YES if I change the option, but it's not working.

Screenshot_2.png

 

What am I doing wrong?

2 REPLIES 2

VEEN PRANEETH K
Tera Contributor

Hi @rafaelalves4337 

You can use a simple UI Policy with your dependancy question, it works. It would be better if you change your "Yes or No" choice question to Yes/No Type field. That will help you easier.

Here i made 2 questions Q1 and Q2, with same scenario and i populate the country field only when i select Q1 yes. Even if i switch with Q2 Yes or No options it will not impact.

VEENPRANEETHK_0-1717695352138.png

 

VEENPRANEETHK_1-1717695393028.pngVEENPRANEETHK_2-1717695431713.pngVEENPRANEETHK_3-1717695475122.png

 

Feel free to reach me, I can help you on this.

 

Thanks,

Veena Praneeth

Dnyaneshwaree
Mega Sage

Hello @rafaelalves4337 ,

Instead of any other client script,

 

You need to add more UI actions in the UI policies for the fields that need to hide (visible = false) for this condition after the existing UI action present for visibility.

 

You need to add clear value logic in the your all UI policies script in a way that add clear value in false script for the variables that has UI action present below for visibility (visible = true). Means for reverse UI policy that variables should hide.

 

Dnyaneshwaree_0-1717762056271.png

 

Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru