Use of or to link multiple conditions

I've added a Choose One question which inludes a relevant statement so as to be shown when a particular language from an earlier Choose One question is selected.

The relevant statement is written as;
/data/home = "ESP"
where home is the data name of the preceding question and ESP is the underlying value within the Options table.

This works fine as is.

I would now like to amend the relevant statement such that the second Choose One question appears if either ESP or another value e.g. ENG, is selected.

I've tried including or, and also tried separating the values by comma and by semi-colon in an uneducated guess at the syntax required but all to no avail.

I could of course just repeat the question for each language separately but it would be more elegant via the correct syntax.

Would anyone be able to advse.

Solved, needed more care using "or".

Working as intended.

hi @panthonyl you can consider using this syntax for the relevant statement.

/data/home = "ESP" or /data/home = "ENG"
try this and let us know if it works for you, if it doesn't work you can kindly share with us a sample file and explain how you want the relevant to work on the each question.

thanks
fabla2020@gmail.com

1 Like

Hi @Fabla

Thanks. I'd managed to work it out but couldn't delete my post.

Your syntax was of course exactly what was required.

Now the post is marked as solved it may help someone else struggling with the same issue.

Many thanks,

Patrick

2 Likes

Hi panthonyl,

I want to implement below mention code (Using OR operator both work at a time),but it's not working.

(/data/Province != 'ICT') OR (/data/worker_CNIC != 'Alien')

Please guide me.
Regards,

Could you attach your form? I think small letters are required and it should be or not OR.

I also use small letters or but not working.

Ok but it's difficult to tell what's wrong without the form.

Hi @tasadduq786,

Have you tried referring the variables using the curly brackets?

I would try re-writing the condition as:
${Province}!='ICT' or ${worker_CNIC}!='Alien'

I hope this helps!

Best,
Andrea

No working.

Here is my code:
OR_Operator.xml (8.4 KB)

Here is my code:

OR_Operator.xml (8.4 KB)

Can you kindly share the xls definition.

Thanks Andrea_Martin,
I built form using odk build v3.5.
Here is odkbuild file and xml i already shared.

alien_ict.zip (3.5 KB)

Regards,