Conversation Parameter Validation


As a skills builder administrator or developer you can validate the user's input for mandatory conversation parameters. It helps prevent incorrect data input during a conversation.

You can use regular expressions for each mandatory conversation parameter to ensure the user's input is valid. You can choose from the available regular expression templates or create your own. The regular expression engine checks the data and returns if it finds any text that matches the expression pattern. Regular expressions help in performing validations against the strings/text which the user specifies. 

The following list displays the out of the box templates for validation:

  • Phone number
  • IP Address
  • Number
  • Email address

Input Validation

To validate the user's input, perform the following steps:

  1. Select one of the regular expression templates from the list in the Input Validations window. Regular expressions are a sequence of characters that define a search pattern and are used for syntax highlighting systems, data validation, and in search engines such as Google, to try to determine an algorithmic match to the query a user is asking.
    These templates consists of predefined regular expressions.
    These are the available options:
      - Email address
      - Phone number
      - IP address
      - Number
    For example, a regular expression for an email address is ^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$. This regular expression can be used for checking if a given set of characters is an email address or not.

  2. Regular expressions are populated automatically based on the selected template.
    Note: Any modifications done to the regular expression will not be saved in the template.
  3. Type the message in the Validation Fail Message text box, which you want to display in the chat window for the end-user when the validation is not successful. For example, "the email address specified is incorrect. Please enter a valid email address".
  4. Type the user's input in the Text Input field to verify the accuracy on the right side of the Input Validations window.
  5. Click Validate. 
          -If the user input aligns to the regular expression format, this message appears "Expressions and text inputs are valid".
          -If the user input does not align to the regular expression format the message which you typed in the Validation Fail Message text box will be displayed.
  6. Click Done to save the input validation details. Or click Cancel to exit if you do not want to save the details.

Valid Input in Chatbot

The following image displays a successful input entry in chatbot via conversation parameter validation.

Invalid Input in Chatbot

You are allowed to make three invalid entries in the chatbot while using the conversation parameter validation. After the third incorrect input in the chatbot, the Quick Reply options will be displayed or the Fallback skill will be executed, if specified in Fulfillment.

The following video provides an overview of conversation parameter validation.