DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Compares two values using a specified operator. The operation supports both numeric and string comparisons, and automatically determines the appropriate comparison type.
This helper is available in the Winter ’26 release of Marketing Cloud Next (API version 65.0).
1{{compare leftValue operator rightValue}}| Parameter | Type | Description |
|---|---|---|
leftValue | Any | Required. The left operand for comparison |
operator | String | Required. The comparison operator to use. Accepted values:
|
rightValue | Any | Required. The right operand for comparison |
The operation returns a boolean value (true or false) based on the result of the comparison.
The compare operation uses logical rules to evaluate the relationship between the leftValue and rightValue properties, according to the selected operator. It examines the types and values of both operands and determines the appropriate comparison strategy.
If the operator is == or !=, the operation follows these rules:
null, they’re considered equal and the operation returns true. If only one value is null, the operation returns false.true is equal to the string "true"."5.0" is equal to the number 5."Hello" isn’t equal to the string "hello".If the operator is >, >=, <, or <=, the operation follows these rules:
{{compare "5.5" ">" 3}} returns true.{{compare "apple" "<" "banana"}} returns true.