Condition if-else with only 2 arguments in XLS forms

Hey everyone.

I'm trying to set a constraint using the if-else statement with only 2 arguments but when I reach the question with this constraint the following error message appears (If requires 3 arguments).
What I'm trying to code is:
if the previous answer is yes, this answer should be different than yes and if the previous answer is no, this answer should be different than no.
I'm using this line of code:
if(selected(${prev_q},'yes') , . !='yes') and if(selected(${prev_q},'no'), . !='no')

thanks everyone

Hi @hedi

The constraint you have written have issue. You cant use boolean "and" like that.

Modify to this if(selected(${prev_q},'yes') , . !='yes', . !='no')

1 Like