Formula - startswith
Section titled “ Formula - startswith”The startsWith function, one of the Logical functions in the Formula plugin for Search Field Expressions, returns true when the content starts with the expression (prefix).

Animated walkthrough: on the Order Received JSON of the Order-to-Cash demo, toUpperCase of jsonPath('$.customer.name', body) returns TAILSPIN TOYS. startsWith('ORD-', jsonPath('$.orderId', body)) returns true for ORD-10005. With the prefix 'INV-' there is no match, and the Test tab shows Processed with warning: The Expression yields no result.
Syntax
Section titled “ Syntax”startsWith('expression', content [, content ...] [, matchAllValues])Parameters
Section titled “Parameters”| Parameter | Required | Description |
|---|---|---|
'expression' |
✅ Yes | The prefix to look for, in single quotes, for example 'G'. It's case-sensitive: startsWith('g', body) on GMT gives no value. |
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 starts with the expression.- When it doesn't, there is no value: Test Expression shows Processed with warning: The Expression yields no result.
- 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”startsWith('G', body)Result
Section titled “Result”true
The message body GMT starts with G, so startsWith 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”startsWith('G', context('id'))Result
Section titled “Result”true
The context value of id is GMT, which starts with G, so startsWith 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”startsWith('U', regex('GMT|UTC', body))Result
Section titled “Result”true
regex extracts GMT and UTC; UTC starts with U, and one match is enough, so startsWith returns true.
Example 4: Check several message context values
Section titled “Example 4: Check several message context values”Message Context:
| Key | Value |
|---|---|
id |
UMT |
id1 |
UZZ |
Formula
Section titled “Formula”startsWith('U', context(regex('id.*')))Result
Section titled “Result”true
context(regex('id.*')) returns the values of both keys, UMT and UZZ; they start with U, so startsWith returns true.