# Example of data validation

With the Fallback block, you can create data validation for client messages without programming knowledge.

This validation can be done using regular expressions, and to avoid creating endless loops or kicking the client out when they enter invalid data, you can use the **Fallback** block.

<div data-with-frame="true"><figure><img src="/files/nzkmzWv3gcDBobhDZxOw" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
You can use regular expressions to validate phone numbers, email addresses, dates, and much more.\
A complete list of regular expressions can be found in the article **"**[**Regular expressions**](/chatbot/functions/regex.md)**."**
{% endhint %}

In the block with two outgoing connections, the client’s phone number is requested (this can also be a full name, email, etc.):

<div data-with-frame="true"><figure><img src="/files/WbzE398GIcYGcvL4nmoa" alt=""><figcaption></figcaption></figure></div>

Two connection extend from the block: one to the **Fallback** block and one to the **Chat** block.

<div data-with-frame="true"><figure><img src="/files/YpR72RBPSfc6RHADT9bA" alt=""><figcaption></figcaption></figure></div>

To allow the client to proceed further in the funnel when entering a valid phone number, specify the following regular expression in the condition of the arrow leading to the **Chat** block:

```
^(\+)?((\d{2,3}) ?\d|\d)(([ -]?\d)|( ?(\d{2,3}) ?)){5,12}\d$
```

and set the match type to **"Regex match"**.

<div data-with-frame="true"><figure><img src="/files/ai3I4BFNx9YMLzpjt0Bq" alt=""><figcaption></figcaption></figure></div>

Done!&#x20;

The flow will work as follows: when the user reaches the block with the message "Enter your phone number," if the client enters anything else, they won’t be able to proceed further in the funnel due to the regular expression validation. Each time an invalid phone number is entered, the message "This is not a phone number" will be sent.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavibot.ai/chatbot/builder/setting/types/data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
