> For the complete documentation index, see [llms.txt](https://helpcenter.channable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules.md).

# Conditions

Select the items a rule changes.

Learn [how conditions work](#how-conditions-work), explore [example conditions](#condition-examples), and view [all available conditions](#list-of-available-conditions).

<figure><img src="https://content.gitbook.com/content/u8whzIfip72Kvn3M1bsc/blobs/5oBNJscwgHCvnszHYfSX/25440514085778" alt=""><figcaption></figcaption></figure>

## How conditions work

Conditions select the import items that a rule changes with an [action](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-actions-then-in-rules.md):

* You can select and apply an action to all items with the `For all items` condition.
* You can select specific items to apply an action to with `IF` conditions.
* You can use `AND` to combine multiple conditions that items need to meet to be included in your selection.
* You can use `OR` to filter and apply a rule to items that meet one or more parts of your criteria.

{% hint style="info" %}

#### Understand how OR conditions are grouped

An `OR` condition expands the condition directly before it. The earlier `IF` conditions still apply.

If you set up these conditions:

* IF value(s) in `color` **`exactly match`** `pink`
* `AND` value(s) in `size` **`exactly match`** `small`
* `OR` value(s) in `size` **`exactly match`** `medium`

This rule selects pink items that are either small or medium. The `OR` applies to the `size` condition, not to the `color` condition.
{% endhint %}

Once you’ve set up your conditions, you can [preview which items have been selected](#preview-selected-items), then [use actions](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-actions-then-in-rules.md) to define what you want your rule to do to the items you have filtered.

### Preview selected items

Check which items your conditions select before adding an action.

Click **Save rule** after you add your conditions. Each condition section shows its selected-item count:

* **X selected items (X%)** shows how many items match the conditions in that section.

Click the selected-item count to inspect the items that match your conditions.

### Condition examples

<details>

<summary>Example: Use an <code>IF</code> condition to select items that have an empty <code>title</code> field</summary>

To filter any items that are missing a title in the title field, you would set up your condition like this:

* IF the `title` field **`is empty`**

</details>

<details>

<summary>Example: Use an <code>AND</code> condition to select items where <code>size</code> exactly matches <code>small</code> and <code>color</code> exactly matches <code>pink</code>.</summary>

To filter any items that are size small and the color pink, you would set up your condition like this:

* IF value(s) in `color` **`exactly match`** `pink`
* `AND` value(s) in `size` **`exactly match`** `small`

</details>

<details>

<summary>Example: Use an <code>OR</code> condition to select items where <code>color</code> exactly matches <code>pink</code> or <code>size</code> exactly matches <code>large</code>.</summary>

To filter items that are pink, large, or both, set up your conditions like this:

* IF value(s) in `color` **`exactly match`** `pink`
* `OR` value(s) in `size` **`exactly match`** `large`

</details>

<details>

<summary>Example: Combine <code>AND</code> and <code>OR</code> to select pink items in either a small or medium size.</summary>

To filter pink items that are small or medium, set up your conditions like this:

* IF value(s) in `color` **`exactly match`** `pink`
* `AND` value(s) in `size` **`exactly match`** `small`
* `OR` value(s) in `size` **`exactly match`** `medium`

</details>

### List of available conditions

| Condition                            | Use case                                                                                                                                                                                                                         |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`For all items`**                  | [Apply a rule to all items](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/apply-a-rule-to-all-items.md)                                              |
| **`Contains any of`**                | [Match text and list values](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/match-text-and-list-values.md)                                            |
| **`Exactly matches any`**            | [Match text and list values](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/match-text-and-list-values.md)                                            |
| **`Exactly match`**                  | [Match an exact value](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/match-an-exact-value.md)                                                        |
| **`Equal to`**                       | [Match text and list values](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/match-text-and-list-values.md)                                            |
| **`Is empty`**                       | [Find empty fields](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/find-empty-fields.md)                                                              |
| **`Is less than`**                   | [Compare numeric values](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/compare-numeric-values.md)                                                    |
| **`Is less or equal to`**            | [Compare numeric values](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/compare-numeric-values.md)                                                    |
| **`Is in top`**                      | [Select items with the highest or lowest values](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-condition-is-in-highest-x-is-in-lowest-x.md)     |
| **`Is in bottom`**                   | [Select items with the highest or lowest values](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-condition-is-in-highest-x-is-in-lowest-x.md)     |
| **`Has more characters than`**       | [Select items by character count](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-condition-has-more-characters-than-has-less-characters-than.md) |
| **`Has less characters than`**       | [Select items by character count](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-condition-has-more-characters-than-has-less-characters-than.md) |
| **`Has more words than`**            | [Select items by word count](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-condition-word-count-exceeds-doesnt-exceed.md)                       |
| **`Has exactly or less words than`** | [Select items by word count](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-condition-word-count-exceeds-doesnt-exceed.md)                       |
| **`Is not a valid GTIN number`**     | [Find invalid GTINs and EANs](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-condition-is-not-a-valid-gtin-number.md)                            |
| **`Is equal to`**                    | [Select items by date](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-conditions-dates.md)                                                       |
| **`Is on or after`**                 | [Select items by date](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-conditions-dates.md)                                                       |
| **`Is before`**                      | [Select items by date](https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-conditions-dates.md)                                                       |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://helpcenter.channable.com/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
