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.
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.
2
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.
3
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.
4
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.
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.
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
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.
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.
2
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.
3
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.
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.
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
1
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.
2
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.
3
Re-test after changes
After updating the condition, test the workflow again with a contact to confirm the correct branch is now followed.
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.
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.
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.