# If-then

## What is If-then?

If-then **allows one Pipe to perform different actions based on rules you define.** Using conditional logic, these rules determine the subsequent steps, for example, If response is A, then do X. If response is B, then do Y.

## If-then

| 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 | Set the logical condition                                                       | :heavy\_check\_mark: |
| Condition    | Set the logical condition                                                       | :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. Your Pipe will continue to the next steps.</td></tr><tr><td>false</td><td>The condition you set is not met. Your Pipe will stop here.</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>


---

# 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://guide.plumber.gov.sg/user-guides/actions/if-then.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.
