Multiple Select input nodes allow end users to select one or more answer options from a list. Implementing logic with these multiple end user answers has some pitfalls – learn to avoid them in this tutorial.
Only one path can be followed
When asking your end user to select answer options in a Multiple Select input, it can be tempting to proceed with logic that you may be familiar with from Single Select inputs. However, this can lead to unintended behavior:
For example, if an end user selects two insurance options, you may want to ask a follow-up question for each selected option, such as the Sum Insured. However, by default, only one path will be followed, and the end user will be asked for the Sum Insured for just one of the selected insurances.
To ask a follow-up question for each answer option selected in the Multiple Select input, the module must be built differently.
Add follow-up nodes on each answer option
To build logic that deals with each selected answer option separately, proceed as follows:
-
Create a Multiple Select input.
-
Add the follow-up node(s) for only the first answer option of the Multiple Select input.
-
Add an Empty action after the follow-up node(s). Add an else-transition from your Multiple Select input to the Empty action. Now, the follow-up node is shown only if the first answer option was picked in the Multiple Select input.
-
Repeat the pattern for the second, third, and all other answer options of the Multiple Select input.
-
Now, you have implemented valid logic after Multiple Select nodes!