By default, the "Mobile" validation allows users to enter 6-20 digits when they are responding. We have given this flexibility since the number of digits in a phone number varies by country. "Mobile" validation checks for two things - 

  1. User response is in number and does not contain any alphabets.
  2. It has 6-20 digits

In case you want to put a hard limit on the number of digits a user can enter, here is what you need to do :

  1. Select "Text Input" as the user input format and select "Mobile" validation in the gambit where you are asking for user's phone number.

2. Now enable Conditional Jump feature. Check the image below to see where it is - 

3. Once you enable the conditional jump feature, you would see a layer open up where you can define conditions on the user response. In this case, we need to put a condition on the gambit where you are asking for user's phone number which is this particular gambit itself.

So here is the condition you need to put in : 

{{ursp.phone.length}} is 10

where "phone" is the name of the gambit where you are asking user's phone number and "10" is the number of digits you want to restrict this response to.

You can change "phone" and "`10" to anything of your choice.

Here is how it would look like : 

Once you click on Save, you will see two branches created for this particular gambit. Like this :

User will enter in the "first branch" is the condition is true which means that the number entered should be of 10 digits. User would go to the second branch/default branch if they enter a number which does not satisfy this condition.

So as a next step, we need to create two gambits for each of these branches. And your flow should start looking like :

 Let me show you what's behind the two gambits :

Thanks[2] - User has entered correct number here and since it satisfied the condition, we have just closed the chat.

phone_error[3] - This is where you can define a error message and ask them for the correct phone number again. And specify the same condition for this gambit as well.

Now for this gambit phone_error[3], you will again have 2 branches to move forward.

Connect the first one to Thanks[2] since the user has now given the correct number. The default branch for this one can be connected back to the same gambit so that this keeps on going in loop unless user gives a response that satisfies the condition.

This is what your final flow would look like.

Hope that helps.

Did this answer your question?