- 2 minutes to read

Formula - notequal

The notEqual function, one of the Logical functions in the Formula plugin for Search Field Expressions, returns true when the content differs from the expression.

Syntax

notEqual('expression', content [, content ...] [, matchAllValues])

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

  • true when the content differs from the expression.
  • When it doesn't, there is no value: Test Expression shows Processed with warning: The provided expression yielded no result.
  • When one content argument returns several values, one matching value is enough, unless matchAllValues is true.

Quoting, nesting, and how content is resolved are described in the Formula language rules.

Examples

Example 1: Check the message body

Input

Message Body:

UTC

Formula

notEqual('GMT', body)

Result

true

Test Expression with notEqual('GMT',body) on the message body UTC, returning true
The message body UTC differs from GMT, so notEqual returns true.

Example 2: Check a message context value

Input

Message Context:

Key Value
id UTC

Formula

notEqual('GMT', context('id'))

Result

true

Test Expression with notEqual('GMT', context('id')) on the context key id with value UTC, returning true
The context value of id is UTC, which differs from GMT, so notEqual returns true.

Example 3: Check values extracted by another function

Input

Message Body:

GMT UTC

Formula

notEqual('CET', regex('GMT|UTC', body))

Result

true

Test Expression with notEqual('CET', regex('GMT|UTC', body)) on the message body GMT UTC, returning true
regex extracts GMT and UTC; neither is CET, so notEqual returns true.

Next Steps