# Data responder

When building an app, you can set events for the components in order to listen to the changes of certain data. For example, for a **Table** component, the built-in events for the change of the `selectedRow` property include "Row select change", "Filter change", "Sort change", and "Page change".

However, there lacks similar events for some data changes, such as the changes of temporary states, transformers, or query results. Data responders are designed for these cases and allow you to listen and respond to any data change.

{% hint style="info" %}
Events for data responders are more general than the events that listen to data changes such as content change, row select change, etc.
{% endhint %}

## Listen to data changes

In query editor, click **+ New**, and then select **Data responder** to create a new data responder.

<figure><img src="/files/g0ngRrcDPKssyTofNzOE" alt=""><figcaption></figcaption></figure>

You can set the data that data responder listens to. It supports all kinds of data formats, including number, string, array, and JS object. In the following example, any value change in the **Text** component triggers a global notification.

<figure><img src="/files/XvnA1DbYjqdQhwTsfZy4" alt=""><figcaption></figcaption></figure>

If the data is in array or JS object format, then data change from any sub-element will trigger the configured event. For example, the data of `dataResponder2` is a JS object, which listens to two **Input** components in the app. Data change of any component triggers the same global notification.

<figure><img src="/files/yy3qcWNCNxnMrspmKA0D" alt=""><figcaption></figcaption></figure>

## Respond actions

For detailed information, go to [Event handlers](/build-apps/event-handlers.md) > [Actions](/build-apps/event-handlers.md#actions).


---

# 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://pocketblocks.pedroza.dev/build-apps/write-javascript/data-responder.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.
