# Add conditions to interactions

Conditions are used to control the action flow by determining whether certain action should be executed. The action won't be invoked if the condition returns false.&#x20;

You can find action condition at the top right corner of the [action panel](/app-builder/app-construction/interactions/add-an-interaction.md#add-action-from-event).&#x20;

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

### Access data in condition

* #### Access event data

  `event.field_name`. For example, event.value >= 10 represent the condition that the value event emit is larger than 10. Other variables in action input is also available.
* #### Access element level data

  `field_name`
* #### Access page level data

  `#page.field_name`
* #### Access app level data

  `#app.field_name`. For example, a string app data named "current\_user", #app.current\_user == 'admin' represent the condition that current user is 'admin', meaning the action will only be invoked if current user is admin.
* #### Access query node data

  `#query_node_name`.  For example: `#query_node_name.length >= 5` represents the condition that the query node have more than 5 elements, meaning the action won't be invoked if the query node have less than 5 rows.

### Examples

<figure><img src="/files/sJ8ysNnndZcW2OPQDEUu" alt=""><figcaption><p>(Without Condition) Action after enter input</p></figcaption></figure>

Assume we have an action **Set text** after **Press Enter** for **Input**. For example, in the preview, we input a '2' in the box and press enter, then the text element is set to '4'.

Now, we add a condition `event.value <=10` to the action. By doing this the action will only be executed when the input value is no more than 10. Then we Click Update and Preview to test. In preview, when a number equal or less than 10 entered, the number will double and set in the text element. On the other hand, if a number larger than 10 is entered, no changes will occur.

<figure><img src="/files/IAQ2jWu3qMZHDK5cGh44" alt=""><figcaption><p>(Without Condition) Action after enter input</p></figcaption></figure>

<figure><img src="/files/GhQNfZJf4HzazwvsM8L7" alt="" width="240"><figcaption><p>Test in preview</p></figcaption></figure>


---

# 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.acho.io/app-builder/app-construction/interactions/add-conditions-to-interactions.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.
