Previous Next

Fields and groups in your survey can be shown – or not – depending on the conditions you set for their relevance. (In other settings, "skip patterns," "branching," or "filtering" terminology is used for this kind of logic.)

In the form designer, you can control the relevance settings whenever you add or edit a field or group. The easiest way to build a relevance expression is to ask our AI-powered form tools or AI Assistant for help. Both are located within the online form designer, which is accessed through any form in the Your forms and datasets section of your server’s Design tab.

In the spreadsheet form definition, you can enter an expression into the relevance column to control when the field or group should display. It will then show up to users only when that expression evaluates to true; otherwise, it will remain hidden (and its response will be empty).

Typically, whether a question displays will depend on the responses to prior questions. For example, you might ask for informed consent at the beginning of your survey. Then, for all remaining questions, you might want to include "${consent} = 1" in the relevance column. That way, all remaining questions are automatically skipped when consent is not given. Another approach is to enclose all consent-requiring questions within "begin group" and "end group" rows, then specify the relevance expression on the "begin group" row – so you only have to enter the expression once (see Grouping and repeating questions).

Of course, there may be multiple criteria for displaying a certain question. For example, the relevance expression for a question about the fourth household member might look like "${consent} = 1 and ${nhhmembers} > 3".

For details on hand-creating or hand-editing relevance expressions, see the Using expressions in your forms help topic.

While a screen is displayed, its relevance expressions are re-evaluated whenever an answer on that screen that they depend on changes. So if you use a "field-list group" to display multiple questions on one screen, one question can appear or disappear as soon as another question above it on that same screen is answered, without the user having to leave the screen. Calculations are re-evaluated in the same way, so question labels, hints, choice lists, and displayed calculated values keep up with what has been answered on the screen.

This requires the SurveyCTO server console v2.84 or later for web forms, SurveyCTO Collect v2.81.7 or later on Android, and SurveyCTO Collect v2.81.2 or later on iOS. Earlier versions evaluate a screen's relevance expressions only once, when the screen is first displayed: there, one question cannot appear or disappear based on the answer to another question on the same screen, and such skip patterns require the questions to appear on separate screens.

Note that constraints are not checked while a screen updates in this way. As before, field validation happens when the user moves forward through the form.

For a detailed guide on using relevance expressions, including examples you can use in your own forms, check out our support article on implementing skip patterns with "relevance".
Previous Next