ODK v2.0 Any examples of more complex skip logic than in currently available documentation

Hello all,

I’m trying to convert a form created for ODK V1.0 to a format suitable for ODK V2.0.
There is quite a lot of skip logic (some of which is more complex than current documentation) in the form and I haven’t yet been able to find any sample forms that can address my questions.

For example:
I’m trying to convert the following:
${prefecture}!=10 and ${prefecture}!=11 and ${participation_status}=1 and ${prefecture}!=12

All of the above questions are select_one question types

But I am unable to find how I can choose “!” and unclear about how to combine multiple elements as well as the appropriate symbol to use for “and” as well as “or”.

Any clarification would be greatly appreciated.
Thank you very much.
Best,
Patrick

Dear Patrick,

The syntax for skip patterns is quite different in ODK 2. For select one skips, you need to use something like selected(data(‘participation_status’), ‘1’)

For the select_one to negate it, you need to use “not()”, e.g. (not(selected(data(‘prefecture’), ‘10’))

I would actually, from experience, advise against using not() whenever possible, because it is much harder to make sure that you consider all cases that might be not in complex skip patterns than it is to consider who should be answering the question.

Generally, or is written as: ||
And is written as: &&

I am attaching one of our shorter subforms, a labor market history sub-form, that has a bunch of examples:
quest2_07_0.xlsx (59.6 KB)

Hope that helps!

Best,
Caroline

Dear Caroline,

Once again, thank you very much.

This is exactly what I was looking for and thank you for the tips around skip patterns!

Best,

Patrick