Formula - equal
Section titled “ Formula - equal”The equal function, one of the Logical functions in the Formula plugin for Search Field Expressions, returns true when the content equals the expression.

Animated walkthrough: on the JSON Order Received event of order ORD-10005 in the Order-to-Cash demo, equal('USD', jsonPath('$.currency', body)) returns true. With 'SEK' there is no value, not false, and with 'usd' there is no value either, because the comparison is case-sensitive.
Syntax
Section titled “ Syntax”equal('expression', content [, content ...] [, matchAllValues])Parameters
Section titled “Parameters”| Parameter | Required | Description |
|---|---|---|
'expression' |
✅ Yes | The text to compare with, in single quotes, for example 'GMT'. |
content |
✅ Yes | The value or values to check: body, context, or another Formula function such as regex. When you give several content arguments, each of them must match. |
matchAllValues |
❌ No | Unquoted true or false (default). Applies when one content argument returns several values: false means at least one value must match, true means every value must match. A quoted 'true' is not the flag; it is compared as text. |
Returns
Section titled “Returns”truewhen the content equals the expression.- When it doesn't, there is no value: Test Expression shows Processed with warning: The Expression yields no result.
- The comparison is case-sensitive:
equal('gmt', body)on the bodyGMTreturns no value. This differs from regex, which ignores case. - When one content argument returns several values, one matching value is enough, unless
matchAllValuesistrue.
Quoting, nesting, and how content is resolved are described in the Formula language rules.
Examples
Section titled “ Examples”Example 1: Check the message body
Section titled “Example 1: Check the message body”Message Body:
GMTFormula
Section titled “Formula”equal('GMT', body)Result
Section titled “Result”true
The message body is exactly GMT, so equal returns true.
Example 2: Check a message context value
Section titled “Example 2: Check a message context value”Message Context:
| Key | Value |
|---|---|
id |
GMT |
Formula
Section titled “Formula”equal('GMT', context('id'))Result
Section titled “Result”true
The context value of id is GMT, so equal returns true.
Example 3: Check values extracted by another function
Section titled “Example 3: Check values extracted by another function”Message Body:
GMT UTCFormula
Section titled “Formula”equal('UTC', regex('GMT|UTC', body))Result
Section titled “Result”true
regex extracts GMT and UTC; one of them equals UTC, so equal returns true.
Example 4: Check several message context values
Section titled “Example 4: Check several message context values”Message Context:
| Key | Value |
|---|---|
id |
GMT |
id2 |
UTC |
Formula
Section titled “Formula”equal('UTC', context(regex('id.*')))Result
Section titled “Result”true
context(regex('id.*')) returns the values of both keys, GMT and UTC; one of them equals UTC, so equal returns true.
Example 5: Require every extracted value to match
Section titled “Example 5: Require every extracted value to match”Message Body:
<Items> <Item>Hello World</Item> <Item>Hello World</Item></Items>Formula
Section titled “Formula”equal('Hello World', xPath('Items/Item', body), true)Result
Section titled “Result”trueThe unquoted true is matchAllValues: every Item must equal Hello World. If one Item held another text, the formula would return no value, while the same formula without true would still return true.

Both Item values equal Hello World, so the check passes even when every value must match.