Create skip forward logic feature

This is not actually an accurate description of what’s going on… What happens is that every question in a form can have an associated relevant XPath calculation, which if it evaluates to TRUE means the question is displayed, otherwise if FALSE not (ie hidden, or ‘skipped’). Groups may also have an equivalent relevant calculation, which if FALSE means every question (or subgroup) within the group is not displayed. By default relevant is assumed TRUE if unspecified.

These relevant calculations can be completely arbitrary - they can be a constant expression that always evaluates to TRUE (eg “1=1” or the “true()” function), or FALSE (eg “1=0” or the “false()” function), or they may check the results of other questions, either before or after! All these relevant calculations are re-evaluated whenever you answer a question, so anything dependent upon it may appear or disappear at any time, again, irrespective of whether it is before or after. Although it may be natural to write a form with questions only relevant on other questions listed ‘before’ in the form, fundamentally there is no notion of ‘before’ or ‘after’ in an XForm: everything gets constantly re-evaluated irregardless of the partial ordering of the questions in the form.

To summarize, there is in fact no “skip logic” in XForms (sorry, its a bit of a mis-nomer)… Rather, its show-hide logic, where you define under what circumstances each specific question (or group of questions) should be displayed, or not. So if you want to ‘skip’ something, then you must define when to hide everything in-between [sic].

Hopefully that helps clarify (?)

All that said, skipping to a specified question in the form is a fundamentally different flow control model, not something that the XForms standard supports, and therefore not something that I would anticipate showing up in ODK Collect/KoboCollect anytime soon. If you want this sort of thing you probably need to be looking at an architecturally different form model and tool chain (eg ODK-X)

2 Likes