Conversation Parameter Validation

Overview

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


Note

The phone number template supports a ten-digit number with hyphens that used in countries such as the United States. For example, if the specified template is phone number, a  ten-digit phone number with hyphens will be validated such as 333-333-1234. For a different phone number format, such as India or Brazil, you need to use a different regular expression. To learn more about regular expressions, refer to regex101.com.


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.

    Note

    You can also create regular expression according to your requirement. If you want to create a regular expression, do not select a template in the dropdown. You can refer to content available online to understand the process to create regular expressions. regex101.com is a great resource for regular expressions.  

  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. 
    Note:
          -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.

© 2019 Serviceaide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com