OpenDialog Docs
OpenDialog 2023.1

Message type: Form block

Form message type
The form message lets you create more complicated message inputs that are great for capturing structured information about the user use as addresses or full names.
You can only add one form message type to each message, and it should be the last message in the list to work properly.
Example form message with address fields


Each form message has the follow properties:
  • Text: Form text can optionally be set and will be displayed at the top of the form message if set
  • Button text: The text to display on the submit button shown at the bottom of the form message.
  • Callback: Similarly to the 'simulate user intent' button messages, this field needs to be set to point to the next intent in the conversation flow. When clicked on, a list of all conversations for the current scenario is show listing each intent that is part of them. Either select the corret user intent, or create a new one using the drop down interface. See button message for more info
Each form messagee can have as many fields as needed to capture the information required. There are 4 main types of form fields:
  • Short text
    • Short text fields have 3 sub-types that control what information can be entered in the field: alphanumeric, numeric or email. email types will be validated before submission
  • Long text
  • Dropdown
  • Checkbox
Adding a new form field to a form message
Each form field must specify:
  • Field Label. This is what is displayed next to the input in the message. It can be left blank to not display anything
  • Field options (for drop down and checkbox types only). What options to present to the user in the select drop down or checkbox list
  • Attribute name. You must specify the name of the attribute that the value entered will be saved against. By default, the attribute will be saved to the user context when the form is submitted
  • Default value. If set, the form field will be pre-populated with this value. It can either be a hard-coded value, or it can use OpenDialogs attribute filling system to take the value of an attribute from a context. Eg {user.first_name} will user the value of the first_name attrbute from the user context
  • Optional field. If not set, the field must have a value set before the form can be submitted

Another example: multi-select checkbox form message

Here is an example of a checkbox form message. This message type allows for multi-select. The selected options (whether 1 or more) are captured as the value for the attribute that is listed in the "Attribute name (required)" field. This attribute can be defined "on the fly" just by entering it here, or could be predefined as a dynamic attribute.
Preview of a multi-select checkbox form message
Message editor page for the multi-select checkbox form message
In this example, we gather the user's interests and provide simple recommendations based on the selected interests. For instance, if they selected weight management, the next message will provide information relevant to weight management.
To do so, the attribute is used as a condition on the message in a next turn:
Message list with messages that have conditions
Message editor Conditions tab