Defining and using conditions in trigger rules
Operator | Description | Example |
---|---|---|
equals | Exact equality | {"field": "user.role", "operator": "equals", "value": "admin"} |
notEquals | Inequality | {"field": "user.status", "operator": "notEquals", "value": "inactive"} |
contains | String contains | {"field": "user.email", "operator": "contains", "value": "@gmail.com"} |
notContains | String does not contain | {"field": "user.email", "operator": "notContains", "value": "test"} |
startsWith | String starts with | {"field": "document.title", "operator": "startsWith", "value": "Draft:"} |
endsWith | String ends with | {"field": "file.name", "operator": "endsWith", "value": ".pdf"} |
greaterThan | Numeric greater than | {"field": "payment.amount", "operator": "greaterThan", "value": 100} |
lessThan | Numeric less than | {"field": "payment.amount", "operator": "lessThan", "value": 50} |
greaterThanOrEqual | Numeric greater than or equal | {"field": "user.age", "operator": "greaterThanOrEqual", "value": 18} |
lessThanOrEqual | Numeric less than or equal | {"field": "product.stock", "operator": "lessThanOrEqual", "value": 5} |
in | Value in array | {"field": "user.role", "operator": "in", "value": ["admin", "editor"]} |
notIn | Value not in array | {"field": "user.country", "operator": "notIn", "value": ["US", "CA"]} |
exists | Field exists | {"field": "user.phoneNumber", "operator": "exists"} |
notExists | Field does not exist | {"field": "user.deletedAt", "operator": "notExists"} |
isTrue | Boolean is true | {"field": "user.emailVerified", "operator": "isTrue"} |
isFalse | Boolean is false | {"field": "user.suspended", "operator": "isFalse"} |
matches | Regex match | {"field": "user.email", "operator": "matches", "value": "^[a-z0-9]+@[a-z]+\\.[a-z]{2,3}$"} |
AND
: All conditions must be trueOR
: At least one condition must be true