Formula - endswith
The endsWith function, one of the Logical functions in the Formula plugin for Search Field Expressions, returns true when the content ends with the expression (suffix).

Animated walkthrough: the Order Received event of order ORD-10005 in the Order-to-Cash demo has the context value FileName ORD-10005-order-received-from-customer.json. endsWith('.json', context('FileName')) returns true; endsWith('.xml', context('FileName')) gives "Processed with warning: The Expression yields no result": no value, not false.
Syntax
endsWith('expression', content [, content ...] [, matchAllValues])
Parameters
| Parameter | Required | Description |
|---|---|---|
'expression' |
✅ Yes | The suffix to look for, in single quotes, for example 'T'. |
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
truewhen the content ends with the expression.- When it doesn't, there is no value, not
false: Test Expression shows Processed with warning: The Expression yields no result, and the Search Field gets no value. - When one content argument returns several values, one matching value is enough, unless
matchAllValuesistrue. - The check is case-sensitive and follows the culture rules of the server, like startsWith.
Quoting, nesting, and how content is resolved are described in the Formula language rules.
Examples
Example 1: Check the message body
Input
Message Body:
GMT
Formula
endsWith('T', body)
Result
true

The message body GMT ends with T, so endsWith returns true.
Example 2: Check a message context value
Input
Message Context:
| Key | Value |
|---|---|
id |
GMT |
Formula
endsWith('T', context('id'))
Result
true

The context value of id is GMT, which ends with T, so endsWith returns true.
Example 3: Check values extracted by another function
Input
Message Body:
GMT UTC
Formula
endsWith('C', regex('GMT|UTC', body))
Result
true

regex extracts GMT and UTC; UTC ends with C, and one match is enough, so endsWith returns true.