Zoho SalesIQ lets you build a fully functional chatbot to automate your live chat operation without a single line of code. With our code-less chatbot builder, all you need to do is create a chatbot flow using the drag-and-drop interface and type in your bot responses.
As part of collecting the visitor information process, fetching the phone number information becomes a crucial step. The phone card can be used to get the visitor's phone/mobile number during the bot conversation. The number collected in this card will be updated as the visitor's phone number automatically in the SalesIQ portal.
Why Collecting Valid Phone Numbers Matters
Phone numbers are essential for:
Sales conversion through call follow-ups
Telephonic support and personalised outreach
Avoiding spam or incomplete lead entries
To ensure that the data collected is accurate, it's important to validate phone number inputs properly.
We are unable to restrict the phone card's input to a specific number. According to the current implementation, we are not allowed to enter more than fourteen numbers and less than seven numbers.
Screenshots:


We understand that not every country uses phone numbers with fixed set of digits. The number of digits in a phone number varies by country and depends on factors like population size and the need for unique numbers. For example, North America uses a 10-digit system with a 3-digit area code and a 7-digit local number whereas in countries like Australia Mobile numbers are 12 or 13 digits and India uses 10-digit numbers, including area codes.
While the Phone card has basic validation, it does not natively enforce specific digit limits (e.g., exactly 10 digits for Indian numbers). We cannot restrict visitors' ability to enter the required number of numbers in accordance with your geographical standards, To handle this, you can implement a workaround using:
- Plug (custom script-based validator)
- Criteria Router (decision logic based on Plug output)
To validate the length of the phone number provided in the phone card, we can connect a script-based plug into the bot which can be configured to validate whether or not the phone number value entered in the phone card has a specific length.
In the script-based plug, we configure both Input and Output parameters:
This ensures that the phone number is validated through the script, and the corresponding validation message is sent back to the bot for further processing.

In the script-based plug, we can incorporate a Deluge script to validate the length of the phone number obtained as an input parameter.
In this case, the script checks the length of the phone number and returns a text string as the output. This output is then stored as a context variable in the bot, which is subsequently used in the criteria router card to route users based on the returned value.
The output of the code will be “Please enter a valid 10-digit phone number” if the phone number entered by the visitor is not exactly 10 digits. Otherwise, it will display “Correct format.”


Sample Plug Code used for this case:
- info session;
- response = Map();
- if(session.containsKey("phone"))
- {
- if(session.get("phone").get("meta").get("phone").isEmpty() == false)
- {
- phone_raw = session.get("phone").get("meta").get("phone");
- }
- else
- {
- phone_raw = session.get("phone").get("value");
- }
- if(trim(phone_raw).len() == 10)
- {
- message = "Correct format";
- }
- else
- {
- message = "Please enter a valid 10-digit phone number";
- }
- }
- else
- {
- message = "Phone number not found in session";
- }
- response.put("message",message);
- return response;
As stated above, the output obtained from the plug, we map it to the Criteria Router where we define a rule to check if the output received is of the message 'Please enter a valid 10-digit phone number'.
If the Criteria Router rule is satisfied, then it is mapped to a message card(with display the output context of the plug code response to make the visitor understand the reason) and then, add a Go to card to Phone card again to collect the valid 10 digits number, unless the visitor add the valid 10 digits number this flow will repeat itself and once they add the proper 10 digit number, the flow is completed as the Criteria Router will route the flow to 'Not Matched' way which lead to the end card.
Kindly find the complete implementation steps of this Zobot, for phone card validation, and it's working as mentioned above, along with the screenshots for your understanding below.
[Zobot Configurations Explained]
Zobot Configuration Screenshot 1:
Zobot Configuration Screenshot 2:
Zobot Configuration Screenshot 3:
Zobot Configuration Screenshot 4:
I hope this gives you a basic understanding of how you can handle such cases where you need validation to be done for the phone number input on the Phone card to avoid junk/spam inputs into your system.
You can look into the above-mentioned case, where I have explained it for the phone number card, and implement it accordingly based on your use-case with the help of your development team to build plug code.
If you would like to leverage your bot's functionality and avoid Junk/Spam leads. You can make use of the help document to create a plug and to verify the visitor's phone number by sending OTP to them.
Custom Solution Created by Prasannah | Zoho Partner Support