# 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.


---

# 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.smartbotpro.io/scripts/actions/extract-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.
