Conditional logic in scenarios
Build smart decision logic into your workflows—no coding required.
What Is a Condition?
Section titled “What Is a Condition?”A condition is a rule that answers a simple yes/no question based on your data.
Examples:
- Is the price greater than $100?
- Is the customer’s age exactly 25?
- Does the product list contain “apple”?
The Condition Evaluator lets you ask these questions and automatically make decisions based on the answers.
How Conditions Work
Section titled “How Conditions Work”Every condition has:
- An operation – what kind of check you’re doing
- Arguments – the values to compare or examine
Basic Format
Section titled “Basic Format”{ "op": "OPERATION_NAME", "arguments": [value1, value2]}
Types of Operations
Section titled “Types of Operations”Comparison Operators
Section titled “Comparison Operators”Used to compare numbers or text:
Operation | Description | Example | Result |
---|---|---|---|
EQ | Equals | 5 == 5 | ✅ Yes |
NE | Not equal | 5 != 10 | ✅ Yes |
GT | Greater than | 10 > 5 | ✅ Yes |
GTE | Greater than or equal | 5 >= 5 | ✅ Yes |
LT | Less than | 3 < 7 | ✅ Yes |
LTE | Less than or equal | 4 <= 4 | ✅ Yes |
Example
{ "op": "GT", "arguments": [25, 18]}
Logical Operators
Section titled “Logical Operators”Used to combine multiple conditions:
Operation | Description | What It Does |
---|---|---|
AND | All must be true | True only if all match |
OR | At least one must be true | True if any match |
NOT | Reverses the result | True becomes false, and vice versa |
Example
{ "op": "AND", "arguments": [ { "op": "GT", "arguments": [25, 18] }, { "op": "EQ", "arguments": ["status", "active"] } ]}
Membership Operators
Section titled “Membership Operators”Used to check if something belongs to a list:
Operation | Description | Example |
---|---|---|
IN | Is a value in a list? | “apple” in [“apple”, “banana”] |
NOT_IN | Is a value not in a list? | “grape” not in [“apple”, “pear”] |
CONTAINS | List contains a specific item? | [“red”, “blue”] contains “red” |
Example
{ "op": "IN", "arguments": ["premium", ["basic", "premium", "enterprise"]]}
Presence & Emptiness Operators
Section titled “Presence & Emptiness Operators”Used to check if something exists or is empty:
Operation | Description |
---|---|
IS_EMPTY | Is it empty? (like "", []) |
IS_NOT_EMPTY | Has content |
IS_DEFINED | Exists and is not null or undefined |
Example
{ "op": "IS_EMPTY", "arguments": [[]]}
Real-World Examples
Section titled “Real-World Examples”Customer Eligibility
Section titled “Customer Eligibility”Is the customer eligible for a discount?
Must be over 18, premium member, more than 5 purchases
{ "op": "AND", "arguments": [ { "op": "GT", "arguments": [21, 18] }, { "op": "EQ", "arguments": ["premium", "premium"] }, { "op": "GT", "arguments": [7, 5] } ]}
Product Availability
Section titled “Product Availability”Show product if:
- In stock OR available for pre-order
- AND customer location is in service area
{ "op": "AND", "arguments": [ { "op": "OR", "arguments": [ { "op": "GT", "arguments": [5, 0] }, { "op": "EQ", "arguments": ["pre-order", "available"] } ] }, { "op": "IN", "arguments": ["New York", ["New York", "California", "Texas"]] } ]}
Order Validation
Section titled “Order Validation”Order must:
- Total > $10
- Email is not empty
- Payment method is defined
{ "op": "AND", "arguments": [ { "op": "GT", "arguments": [25.99, 10] }, { "op": "IS_DEFINED", "arguments": ["credit_card"] } ]}
Tips for Success
Section titled “Tips for Success”- Start with simple checks
- Use correct types (number vs text)
- Build complex logic step-by-step
- Use arrays properly for IN/NOT_IN/CONTAINS
Don’t:
Section titled “Don’t:”- Mix types unless intentional
- Overload a single condition
- Omit required fields (
op
,arguments
)
Handy Patterns
Section titled “Handy Patterns”Range Check
Section titled “Range Check”{ "op": "AND", "arguments": [ { "op": "GTE", "arguments": [25, 18] }, { "op": "LTE", "arguments": [25, 65] } ]}
Multiple Options
Section titled “Multiple Options”{ "op": "IN", "arguments": ["medium", ["small", "medium", "large"]]}
Exclude Values
Section titled “Exclude Values”{ "op": "NOT_IN", "arguments": ["pending", ["cancelled", "failed", "expired"]]}
Troubleshooting
Section titled “Troubleshooting”“Operation cannot be null”
- Add the
"op"
field - Check for typos in the operation name
“Binary operation requires exactly 2 arguments”
- Operations like
GT
,EQ
, etc. need exactly 2 values
“Cannot compare String with Number”
- Use same type for both values (e.g., don’t compare
"5"
with5
)
How to Build a Condition (Step-by-Step)
Section titled “How to Build a Condition (Step-by-Step)”- Start with the question: What are you checking?
- Choose the right operation (EQ, GT, IN, etc.)
- Add the comparison values
- Test simple examples
- Gradually combine with AND, OR, NOT
Wrap-Up
Section titled “Wrap-Up”The Condition Evaluator lets you automate decision-making in your workflows—no code, no hassle. It’s your tool for building clean, readable, powerful logic.
Need help? Reach out at [email protected] or ask your onboarding specialist. We’re always happy to assist.