> For the complete documentation index, see [llms.txt](https://docs.smartbotpro.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smartbotpro.io/scripts/actions/extract-data.md).

# Extract data

{% hint style="info" %}
The "retrieve data" action is an indispensable assistant in obtaining and saving information. With it, you can extract any content from any string in a given format.&#x20;
{% endhint %}

Let's add a block by selecting an action in the additional menu on the left or by right-clicking on a free area of ​​the screen.

![](/files/D0S1Iuj1AeATHrmw5C6N)

The action block menu contains an input value, a message template, a filter, and a variable to write the data to.

![](/files/WI0TcORKVFFiQ9gQBzM8)

The "Input Value" field is an indication of any string from which to extract. &#x20;

{% hint style="info" %}
If you specify the %message% variable as the input value when performing the action, the bot will take data from the subscriber's last message
{% endhint %}

Start typing the pattern and the filters will appear.

![](/files/K2BSnKbqeESBeoDOHENX)

You can specify one of the filters and its settings, and then set a variable in which to write the received data.&#x20;

In addition, you can set *any string format* and extract the necessary data from its parts using a template.
