# Condition

### Overview

The **Condition Component** evaluates expressions and directs data to either the `true` or `false` output port based on the result. It supports logical conditions using multiple operators and can process complex logical groupings.

### Usage

#### Input Parameters

| Parameter    | Type     | Description                                                                       |
| ------------ | -------- | --------------------------------------------------------------------------------- |
| `expression` | `object` | A structured condition with logical operators (`AND`, `OR`) and comparison rules. |

#### Supported Operators

| Operator   | Description                                              |
| ---------- | -------------------------------------------------------- |
| `=`        | Checks if two values are equal.                          |
| `!=`       | Checks if two values are not equal.                      |
| `>`        | Checks if a value is greater than another.               |
| `>=`       | Checks if a value is greater than or equal to another.   |
| `<`        | Checks if a value is less than another.                  |
| `<=`       | Checks if a value is less than or equal to another.      |
| `%`        | Checks if a number is divisible by another (modulo).     |
| `empty`    | Checks if a value is empty.                              |
| `notEmpty` | Checks if a value is not empty.                          |
| `contains` | Checks if a value contains another value.                |
| `range`    | Checks if a value falls within a specified range.        |
| `regex`    | Validates if a value matches a given regular expression. |

#### Output Ports

| Port    | Description                                  |
| ------- | -------------------------------------------- |
| `true`  | Fires if the condition evaluates to `true`.  |
| `false` | Fires if the condition evaluates to `false`. |

### Instructions

1. **Define Conditions**
   * Create conditions using logical grouping (`AND`, `OR`).
   * Choose an operator and provide a comparison value.
2. **Evaluate Inputs**
   * Inputs are compared using selected operators.
   * Logical groups (`AND`, `OR`) allow complex expressions.
3. **Direct Output**
   * If the condition evaluates to `true`, data is sent to the `true` port.
   * If the condition evaluates to `false`, data is sent to the `false` port.

### Notes

* **Logical Groups:** Conditions can be grouped using `AND` and `OR` for flexible logic handling.
* **Range Handling:** Use `rangeMin` and `rangeMax` to check if a value is within a range.
* **Regex Support:** Allows pattern matching for advanced validation.


---

# 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.appmixer.com/connector-configuration/utils/controls/condition.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.
