A Form Element creates an HTML-based form that can be displayed to the user during a chatbot conversation.
Like all Flow types, when creating a chatbot form, you can use:
- text and date input questions
- visual elements like paragraphs and collection displays
- user image upload tools
and also any data used in the Flow that is available via User or System Variables.
Adding a form is especially effective when the Flow uses complex or sensitive processes, like making payments or authentication. Forms provide an easy mechanism for formatting user requests and validating their answers, and also provide better security. In addition, forms can be designed exactly as you need them using Interact, resulting in a more consistent, more intuitive user experience.
Note: When you use a form in your Intent Flow, it always replaces the use of text-based questions or requests from the NLP engine. Form Elements are designed to be used exclusively in the chatbot.
The form collects the user responses and stores them in the variable that you specify in the Form Element, which is passed to and from the NLP engine as a standard JSON object. For example, you can use the Session Context dynamic variable or create a new dynamic variable for this purpose.
You add a Form Element when building or editing an Intent Flow, using the Form Element navigation logic step. A Form Element is indicated on the Flow map by the icon.
You can add multiple Form Elements to any Intent Flow.
Creating a Form Element
- From the Flow map, right-click anywhere and select Add a Step, or hover over the step where you want to add the Form Element. The Navigation Logic menu is displayed.
- Hover over the Navigation Logic icon and click Form Element. The Form Editor opens.
- On the Form tab, enter a unique name for the Form Element in the Page Name field. This is a required field.
- From the list of elements on the left side of the Form Editor, select the first element you want in the Form and drag it to the Page map. On the right side of the Form Editor, the Element tab opens showing an editor for the element you have selected, as shown below:
- Using the editor, complete or change the required attributes for the selected element. (Refer to a particular Page element's Help Center article for more details.)
- Use the Variable Name field to store the user response from the element. For example, you can use the Session Context dynamic variable as shown here:
- Repeat steps 4 through 6 for each element you want to add to the Form.
- To save the Form Element, click Create Form. The Form Element is added to the Flow map.
A Form Element cannot be the last element in your Intent Flow. An additional element, for example, a Response Element, should follow the Form Element in an Intent Flow in order to provide the requested data or confirm performance of an activity.
Editing a Form Element
- Open the Intent Flow containing the Form Element that you wish to change.
- From the Flow map, double-click on the desired Form Element or right-click on it and select Edit.
The Form Editor opens.
- Make the desired changes in the Editor.
- To save your changes, click Update Form. The Form Element is updated on the Flow map.
Deleting a Form Element
- Open the Intent Flow containing the Form Element that you wish to delete.
- From the Flow map, right-click on the element and select Delete. A warning message opens.
- Click Yes. The Form Element is deleted from the Flow map.