Validation

To validate the info provided by the visitors. You can validate the following input fields:

  • email - To validate the email address given by the visitor.
  • phoneno - To validate the phone number provided.
  • website - To validate the website address provided.
  • number - To validate the number or to allow just numbers in the field.
  • number(n-m) - To validate the number and you can also specify the "from" and "to" range of the number allowed.
  • string(n-m) - If the visitor's answer contains a number or other special characters, the Zobot will not validate it. It is only valid if the answer contains alphabetical characters with no space within a given range.
  • decimalPrecision is the number of digits in a number. Scale is the number of digits to the right of the decimal point in a number. For example, the number 123.45 has a precision of 5 and a scale of 2.
  • text - If the visitor's answer's length is greater than or less than the given limit, the Zobot will not accept the answer as valid.  Note: It includes every character in the answer.

Note: To mention the error message is your choice. If you skip "error", then the question will repeat without the error message until the visitor input is valid.

Channel compatibility

 

Output:

Sample Code:

Copied{
  "text": "Hello there! May I have your email address, please? ",
  "validate": {
    "format": "email",
    "error": {"Seems like the value is invalid.","Please enter a valid email address"}
  }
}