Greetings from Zoho SalesIQ!
Ever wondered if you were dealing with only the right details/information during a live chat session? Validation is a crucial process for any business that has hundreds and thousands of customers coming in by the hour. It is essential to validate every detail that is provided by a visitor during a conversation to evaluate the genuineness of the request and to initiate the proper follow-up. A human operator can mostly identify invalid information but chatbots can seldom do so. As a solution to this, Zoho SalesIQ's Zobot has a validation feature.
You can configure your Zobot with this feature to allow it to validate the information that is provided by 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) - To validate the number and you can also specify the "from" and "to" to validate the length(number of characters) of the strings allowed.
Note: You can add an error message while configuring this feature to notify the visitor about the invalid details. If you skip configuring the "error" message, then the question pop-up repeatedly without the error message until the visitor enters a valid input .
Syntax:
- {
- "text": "May I have your email address, please? ",
- "validate": {
- "format": "email",
- "error": {"Seems like the value is invalid.","Please enter a valid email address"}
- }
- }
Sample Code:
- if(!msg.isNull())
- {
- response.put("action","context");
- if(msg.equalsIgnoreCase("Existing Customer"))
- {
- response.put("context_id","existing customer");
- question = {"name":"email","replies":{"Please enter your registered email address",{"field_name":"siq_email","validate":{"format":"email","error":{"Please enter a valid email address"}}}}};
- response.put("questions",{question});
- }
- else if(msg.containsIgnoreCase("Bye"))
- {
- response.put("action","end");
- response.put("delay","30");
- response.put("replies",{"Bye"});
- }
- else
- {
- response.put("action","reply");
- response.put("replies",{"Hey there! Smart Bot here","Got a question? I can help."});
- response.put("suggestions",{"Existing Customer","Looking to purchase","Book Test Drive"});
- return response;
- }
- }
To learn more about this, start building your own Zobot right away.
Regards,
Michelle