Open MercatoDocsSearch docsAPI reference

User guide

Condition Builder

Build a condition from a field, an operator and a comparison value. Group related conditions so you can tell whether one of them or all of them must match.

Build conditions visually to determine when rules apply. Conditions evaluate entity data against criteria you define.

Structure

Simple Condition: field operator value

Group Condition: Combine multiple conditions with AND/OR

Condition Builder Interface Condition builder showing simple conditions and nested AND/OR groups

AND:
  - status = "PENDING"
  - orderTotal > 5000
  OR:
    - customerTier = "GOLD"
    - customerTier = "PLATINUM"

Field Paths

Use dot notation to access data:

Invalid paths show error indicators.

Operators

OperatorDescriptionExample
=, ==Equalsstatus = "ACTIVE"
!=Not equalsstatus != "DELETED"
>, >=, <, <=ComparisonorderTotal > 1000
INIn liststatus IN ["ACTIVE", "PENDING"]
NOT_INNot in liststatus NOT_IN ["DELETED"]
CONTAINSArray containstags CONTAINS "urgent"
NOT_CONTAINSArray not containstags NOT_CONTAINS "archived"
STARTS_WITHString prefixemail STARTS_WITH "admin"
ENDS_WITHString suffixfilename ENDS_WITH ".pdf"
MATCHESRegex matchphone MATCHES "^\\+1"
IS_EMPTYNull/empty checkdescription IS_EMPTY
IS_NOT_EMPTYHas valueassignedTo IS_NOT_EMPTY

Values

Static Values

Dynamic Values

Examples:

expiryDate < {{today}}
createdBy = {{user.id}}
deadline <= {{tomorrow}}

Field Comparisons

Compare two fields instead of field to value. Click "Use field" to toggle.

plannedEndDate < actualEndDate

Building Conditions

  1. Click Add First Condition
  2. Enter field path (e.g., status)
  3. Select operator
  4. Enter value or toggle to field comparison
  5. Add more conditions with Add Condition
  6. Create nested logic with Add Group
  7. Toggle AND/OR on groups
  8. Reorder with arrow buttons
  9. Delete with trash icon

Validation: System checks field paths, operators, and value formats automatically.

JSON Preview

Click Show JSON to view/debug the raw condition structure.

Common Patterns

Range Check:

AND: quantity >= 10, quantity <= 100

Multiple Options:

status IN ["ACTIVE", "PENDING", "APPROVED"]

Exclusion:

status NOT_IN ["DELETED", "ARCHIVED"]

Date Range:

AND: createdAt >= {{2024-01-01}}, createdAt < {{2024-12-31}}

Required Fields:

AND: firstName IS_NOT_EMPTY, lastName IS_NOT_EMPTY, email IS_NOT_EMPTY

Complex Logic:

AND:
  - orderType = "WHOLESALE"
  - orderTotal > 10000
  OR:
    AND: customerTier = "GOLD", accountAge > 365
    - customerTier = "PLATINUM"

Best Practices

Troubleshooting

IssueCheck
Always true/falseField paths, value types, operators, AND/OR logic
Evaluation errorsExecution logs, field path validity, JSON syntax, regex patterns
Case sensitivityStrings are case-sensitive

Next Steps

Previous: Action Builder · Next: Creating Rules