# Data validation

Now let's find out if it is possible to set up data validation using the example of a phone number.

### Option 11

In the "Process message" block there is a checkbox "Use template".&#x20;

This way I can choose the format of the response that I expect from the user. For example, you can set the following pattern: "My phone is ". Whatever the user writes in place between "<" and ">" must follow a certain format. It can be a number, email, phone number:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FFvxQ6J2dvGtx8USsuYOC%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-06-10%20%D0%B2%2016.50.37.png?alt=media\&token=42bf54cf-660c-4c51-89de-e2828df4847d)

If the user writes a message that does not match the template, an error exit will be triggered. Graphically, it is indicated by an exclamation point. Write a hint to the user:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FUr8YBOQUKZ0vbMyxBCwm%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2014.09.34.png?alt=media\&token=c22ca2c9-91eb-491e-afa6-0220aebb82c5)

Now the bot will explain to the user what is expected of him, and will again wait for a response.&#x20;

### Option 2

You can make it easier: add a button to send the phone. This is a native Telegram button that allows the user to send the number associated with the account. Please note that this option is available only in Telegram.&#x20;

Now there is no need for data validation:

![](https://1932399487-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuRfd5lEYYH6D50QjzeAX%2Fuploads%2FN6TN3h8HFuxrNRuppNDY%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-05-19%20%D0%B2%2014.19.05.png?alt=media\&token=8b29af76-a631-471e-ade7-69df36a26901)
