> For the complete documentation index, see [llms.txt](https://guide.plumber.gov.sg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.plumber.gov.sg/user-guides/actions/if.md).

# If

{% hint style="info" %}
If used to be called "If-then". Only the name has changed, existing pipes keep working.
{% endhint %}

## What is If?

If **lets one pipe do different things based on rules you set.** For example, if the response is A, run these steps; if it's B, run those instead.

You can place an If block anywhere in your pipe, not just at the end. Steps inside the block only run when the condition is met. Steps after the block run every time, whichever way the condition went.

## Fields

| Field        | Description                                                                     | Required?            |
| ------------ | ------------------------------------------------------------------------------- | -------------------- |
| Branch name  | Give a name for this branch. We would suggest using the condition as your name. | :heavy\_check\_mark: |
| Field        | Select the variable that you want to check                                      | :heavy\_check\_mark: |
| Is or is not | Choose whether the field should match (is) or not match (is not) the condition  | :heavy\_check\_mark: |
| Condition    | Choose how to compare, e.g. equals, contains, greater than                      | :heavy\_check\_mark: |
| Value        | Set the value that you want to compare the variable against                     | :heavy\_check\_mark: |

## Check step

You can expect one of these two results when you **Check step**.

<table><thead><tr><th width="118.28125">Result</th><th>Description</th></tr></thead><tbody><tr><td>true</td><td>The condition you set is met. The steps inside this If block run, then your pipe continues with the steps after it</td></tr><tr><td>false</td><td>The condition you set is not met. The steps inside this If block are skipped, and your pipe continues with the steps after it.</td></tr></tbody></table>

{% hint style="info" %}
**Check Step** is like a “preview” to see if your rule is working, according to sample data. When your Pipe is running, the result might change because the data that comes in for each execution is different.
{% endhint %}

## Common errors

<details>

<summary>Non-number used in value/field for comparison</summary>

This happens because you are comparing text against a number or vice versa.&#x20;

Make sure that your Field and Value fields are using numbers, if you are using conditions made for numbers (Greater than, Greater than or equals to, Less than, Less than or equals to)&#x20;

</details>
