In this part of the tutorial, we create a flow in the Interaction Designer that displays the collection to the user as a multi-choice Question. The flow consists of the following steps:
- Collect the choices from an external data source, using an Integration Point. For our example, we will use the Integration Point that we created in the previous phase (the get my customers Integration Point).
- Save the choices into a collection.
- Use the collection in a Question element.
The value (or values) selected by the user is saved into a variable or another collection, according to the selection type (single selection or multiple selection).
Our Interaction flow will appear as follows:
To create a Question with dynamic choices:
- From the Interaction Designer, create a new Interaction.
- Create an Integration Point element. From the dropdown list on the General tab, select the Integration Point that you created in the previous phase (get my customers).
- Select the Output Parameters tab, and then create a new variable to hold the customers that are returned by the Integration Point:
a. Expand the User Variables node, and select Add New.
b. From the Variable Definition dialog, in the Reference name field, enter the name my customers.
c. From the Data Type dropdown list, select Collection. Then, from the second dropdown list, select my_customer.
d. To save the new variable, click OK.
- Create a Question element, and define settings in the General tab:
a. Enter a page title and a reference name in the appropriate fields.
b. In the Prompt frame, in the Label textbox, enter Please select a customer to display.
c. From the Question's Type dropdown list, select Multiple choices.
- Select the Choices tab. In the Choices Source frame, select the Use Collection Values radio button. Then, from the first dropdown list in the Collection frame, select the new collection that you created in Step 3.
- Create a new variable named result to hold the user's selection. (In this example, the result is a single object, but you may also choose a collection to hold multiple selections.
- From the Display Options dropdown list, select Radio Buttons (single selection).
- From the Fields tab, select the last_name field for the labels of the radio buttons.
Then, save the Question element.
- Create a finishing Statement element to follow the Question element.
- Run the Interaction.