Handlebars compare
Handlebars compare: checks two values against each other with the operator you pass.
Next
Runtime verified
Test scripts included
Checks two values against each other with the operator you pass.
Syntax
{{compare leftValue operator rightValue}}
Returns boolean.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
leftValue |
any | Yes | Left operand. |
operator |
string | Yes | One of ==, !=, >, >=, <, <=. |
rightValue |
any | Yes | Right operand. |
Example
Tested in a Marketing Cloud Next email on 2026-11-22:
{{compare "5.5" ">" 3}}renderstrue, as documented.{{compare "apple" "<" "banana"}}renderstrue, as documented.{{compare "Hello" "==" "hello"}}rendersfalse, as documented.
Show Next test script
Marketing Cloud Next
Works as documented
Every tested call rendered the documented result. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.