> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Resolving issues with if/else actions in workflows

> Fix common if/else condition problems in HoopAI workflows, including incorrect branch routing, empty field handling, nested condition failures, and custom field type mismatches.

When contacts are routed to the wrong branch in your workflows, the issue typically involves condition logic, empty fields, or data type mismatches. This guide walks you through the most common if/else problems in the HoopAI platform and how to resolve them.

***

## Contacts routing to the wrong branch

<Steps>
  <Step title="Review the condition operators">
    Open the if/else step in your workflow builder and verify the operator for each condition. Common mistakes include using **equals** when you need **contains**, or **is** when you need **is not empty**.
  </Step>

  <Step title="Check the condition values">
    Ensure the value you are comparing against matches exactly, including capitalization and spacing. For example, if you are checking a tag called `VIP Customer`, the condition must match that exact string — `vip customer` will not match with the **equals** operator.
  </Step>

  <Step title="Verify AND vs OR logic">
    If your branch has multiple conditions, check whether they are joined by **AND** (all must be true) or **OR** (any must be true). Click the logic toggle between conditions to switch.
  </Step>

  <Step title="Test with a known contact">
    Use the **Test Workflow** button and select a contact whose data you know. Trace which branch they follow and compare it against the condition logic.
  </Step>
</Steps>

***

## Empty field handling

<Warning>
  If a contact's field is empty (null or blank), most condition operators will evaluate to false, sending the contact to the **Else** branch. This is the most common cause of unexpected routing.
</Warning>

| Operator         | Behavior with empty field                                      |
| ---------------- | -------------------------------------------------------------- |
| Equals           | Evaluates to false — contact goes to Else                      |
| Is not empty     | Evaluates to false — contact goes to Else                      |
| Is empty         | Evaluates to true — contact stays on the If branch             |
| Contains         | Evaluates to false — contact goes to Else                      |
| Does not contain | May evaluate to true depending on the platform's null handling |

<Tip>
  When building conditions that rely on fields that might be empty, add an **Is not empty** check as the first condition in an AND group. This prevents unexpected behavior from null values.
</Tip>

***

## Nested conditions not evaluating correctly

<Steps>
  <Step title="Flatten complex logic when possible">
    Deeply nested if/else steps can be difficult to debug. If you have more than three levels of nesting, consider restructuring your workflow to use separate branches or multiple if/else steps in sequence.
  </Step>

  <Step title="Check each level independently">
    Start from the outermost if/else and verify the condition works on its own. Then move inward, testing each nested level. This isolates which specific condition is failing.
  </Step>

  <Step title="Review the execution logs">
    Go to **Automation > Workflows**, open the workflow, and click **Execution Logs**. Filter by the affected contact and trace their path through each if/else step to find where the logic diverges from your expectation.
  </Step>
</Steps>

<Note>
  Execution logs show which branch a contact followed at each if/else step, along with the field values evaluated at that moment. This is the fastest way to diagnose nested condition issues.
</Note>

***

## Custom field type mismatches

Custom fields have specific data types that affect how conditions are evaluated. A mismatch between the field type and the condition operator will cause unexpected results.

| Field type | Works with                      | Does not work with                             |
| ---------- | ------------------------------- | ---------------------------------------------- |
| Text       | Equals, Contains, Is empty      | Greater than, Less than                        |
| Number     | Equals, Greater than, Less than | Contains                                       |
| Dropdown   | Equals, Is not empty            | Contains, Greater than                         |
| Date       | Is before, Is after, Is empty   | Contains, Equals (use date-specific operators) |
| Checkbox   | Is true, Is false               | Equals, Contains                               |

<Steps>
  <Step title="Confirm the field type">
    Go to **Settings > Custom Fields** and check the data type of the field used in your condition. Make sure the condition operator is compatible with that type.
  </Step>

  <Step title="Update the condition operator">
    If you are using an incompatible operator, open the if/else step and change the operator to one that matches the field type. For example, change **Contains** to **Equals** for dropdown fields.
  </Step>

  <Step title="Re-test after changes">
    After updating the condition, test the workflow again with a contact to confirm the correct branch is now followed.
  </Step>
</Steps>

***

## Best practices

* Use descriptive branch names (e.g., "Has email — send nurture" instead of "Branch 1") so the logic is clear at a glance
* Add an **Else** catch-all branch that logs or tags contacts who do not match any condition, so you can identify gaps
* Document complex condition logic in the workflow's internal notes
* Test every branch path before publishing

***

## FAQs

<AccordionGroup>
  <Accordion title="Can I use custom values or formulas in if/else conditions?">
    If/else conditions support custom field values and contact properties, but not calculated formulas. If you need computed logic, use a webhook to an external service or set a custom field value in a prior workflow step.
  </Accordion>

  <Accordion title="Why does my date condition not match even though the dates look the same?">
    Date fields include time components. If your condition checks for a specific date, the contact's field may include a time that causes a mismatch. Use **Is after** and **Is before** operators with date ranges instead of **Equals**.
  </Accordion>

  <Accordion title="Is there a limit to the number of conditions in a single if/else step?">
    There is no hard limit, but performance and readability degrade with more than 10 conditions in a single step. Break complex logic into multiple sequential if/else steps for clarity.
  </Accordion>
</AccordionGroup>
