Every field in your form will be asked in the exact order it appears in your designer unless you specifically add skip logic (prerequisites) or branching that changes that order. Skip logic and branching allows the answer of one field to determine what fields are asked after that. i.e. any time you want to say “If you answered X, then..." you should use skip logic or branching.
There are two basic forms of logic you can add to your form:
- Skip rules (prerequisites) - skip a field or section that doesn't apply to a certain participant based on a previous response.
- Branching rules - take a participant to the part of the form that is relevant to him/her based on a response.
In many cases, the same result can be achieved using either skip rules or branching. The decision to use one or the other usually depends on:
- The number of fields to be skipped based on a specific response.
- Whether you wish to simply skip a field if some condition is true or go to a specific point in the form.
Skip rules (prerequisites)
Skip rules (prerequisites) are useful when you would like to skip a field or section that should not be answered by a participant based on a previous response they gave.
Example: you want a participant who answers that they are male to skip a field about pregnancy, or to skip a whole section of fields about experiences during pregnancy.
How skip rules work
Skip rules are evaluated before the field or section is shown. Skip rules can be applied to any field type.
It consists of two parts:
- A source field: the answer to this field will determine whether your current field or section is skipped. The source field must be before the field or section you want to skip and must be a numeric, single select or multiple select field type.
- A condition: the current field or section will be skipped if this condition is true. A condition consists of an operator and a value (see table below). If the condition that you've created is true, the field or section will be skipped (i.e. not shown on the handset). Otherwise, it will be displayed.
|Source field type||Operator options||Value of condition|
|Numeric||equal to (=); not equal to (≠); more than (>); less than (<)||any number|
|Single select||equal to (=); not equal to (≠)||one of the source field's options|
|Multiple select||includes; excludes||one of the source field's options|
To create a skip rule:
- Click on the name of the field or the section you wish to add the skip rule to.
- In the drop-down, select 'Add prerequisite'.
- Create your skip rule.
- Select 'Create prerequisite'. If you want to add more than one prerequisite, add each one individually.
- Indicate whether this skip rule should apply only when all the prerequisites are met, or if any one of the prerequisites is met.
- Select 'Save'.
In the example below, the field Reason_not_available (1.4) will be skipped if the field Participant_availability (1.3) is not equal to 'No [N]' OR if the field Consent (1.2) is not equal to 'Yes '.
You can easily remove a prerequisite by selecting the bin icon to the left of the prerequisite, or remove all by selecting 'Remove all prerequisites' below them.
Branching is useful when you would like to route the participant to a different place in the form based on their response to a particular field.
Example: you want a participant who answers that they are male to branch to the section about male contraceptives, and the participant who answers that they are female to the section about female contraceptives.
How branching works
Branching logic is evaluated after the field is asked. Branching can only be applied to numeric, single select or multiple select field types.
It consists of two parts:
- A condition: if this condition is true, the form will branch and your destination field will be displayed next. A condition consists of an operator and a value (see table above).
- A destination field: the branch will take you here if the above condition is met. This can be any other field in the form.
Note: If the destination field has prerequisites, they are evaluated as normal.
You can add multiple branches to a field. The branches are evaluated in order until one is true, and then no further branches are evaluated. Branches are only considered once the constraints added to the field (if any) are met.
To create a branch:
- Click on the name of the field that will create the branch.
- In the drop-down, select 'Manage branches'.
- In the pop-up, create your branch.
- Select 'Create branch'. If you want to add more than one branch, add each one individually.
- Select 'Save'.
In the example below, if the answer to Consent (1.2) equals 'No ', the next field that will be shown is End instruction (4.2).
You can easily remove a branch by selecting the bin icon to the left of it, or remove all by selecting 'Remove all branches' below them.