Rather than entering answer options manually into a Single Select or Multiple Select node, you have the option to use items from a collection as answer options.
This enables you to recycle end user responses as answer options in a subsequent Single Select or Multiple Select node, or even use records from a database or an integration as answer options.
For example, you can empower end users to select an employee from a context-specific and dynamically updated list of employees.
To switch answer options to collection items, click the three dot icon in the configuration area of a Single Select or Multiple Select node. Then, select Use options from a collection and choose a collection field.
Collections as Single Select answer options
When you opt to use collection items as answer options in a Single Select node, the node does not create a Single Select variable. Instead, it generates two variables:
- The collection item itself: You can utilize or reference every field of the selected collection item by the end user, not just the field that is presented as an answer option.
If you only need the presented field, you can activate the Output presented value only toggle. This will output only the answer option field, simplifying variable utilization and referencing. - An index ID containing the position of the chosen item in the collection, starting with 1.
These variables can be employed when building conditions or for referencing purposes.
This image above illustrates an example of referencing a variable from a Single Select node that utilizes a collection as answer options. While the Name field was presented to the end user for selection, you can still reference the Position field, unless you have activated the Output presented value only toggle.
Collections as Multiple Select answer options
When it comes to using collections as answer options in Multiple Select nodes, the process closely mirrors that of Single Select nodes. In this case, the Multiple Select node generates a new collection variable that only contains the selected items. Additionally, Multiple Select nodes also allow you to use collections as default values.
Related topics
- You can also upload an Excel sheet to a database and then read selected records into a module as a collection. This enables you to generate answer options directly from Excel sheets.