Formula - substring
Section titled “ Formula - substring”The substring Formula function returns length characters of the content, starting at the zero-based startIndex.

Animated walkthrough: on the Order Received JSON of the Order-to-Cash demo, jsonPath('$.orderDate', body) returns the order date and time. Wrapped in substring(0, 10, …), ten characters from the first one remain: the date only, such as 2026-11-15.
Syntax
Section titled “ Syntax”substring(startIndex, length, content)Parameters
Section titled “Parameters”| Parameter | Required | Description |
|---|---|---|
startIndex |
Yes | The zero-based position of the first character to return; 0 is the first character. Write it as a number, without quotes. |
length |
Yes | The number of characters to return. Write it as a number, without quotes. |
content |
Yes | The text to take characters from: body, context, or the result of another function, such as jsonPath. |
Returns
Section titled “Returns”The part of the content from startIndex for length characters. When the content holds several values, each value is cut and returned as its own Search Field value.
Examples
Section titled “ Examples”Example 1: Take the first four characters of the message body
Section titled “Example 1: Take the first four characters of the message body”nodinteFormula
Section titled “Formula”substring(0, 4, body)Result
Section titled “Result”nodi
Start index 0 is the first character, so four characters from the start are returned.
Example 2: Take the first word of a context property
Section titled “Example 2: Take the first word of a context property”| Key | Value |
|---|---|
id |
Amazing Function |
Formula
Section titled “Formula”substring(0, 7, context('id'))Result
Section titled “Result”Amazing
Seven characters from the start of the context value Amazing Function.
Example 3: Take the first two characters of several jsonPath values
Section titled “Example 3: Take the first two characters of several jsonPath values”[{ "name": "column" },{ "name": "olive"}]Formula
Section titled “Formula”substring(0, 2, jsonPath('$..name', body))Result
Section titled “Result”cool
jsonPath returns two values, and substring cuts each one: two unique matches.
- A
startIndexpast the end of the text gives no value:substring(10, 4, body)onnodinteshows the warning The Expression yields no result. - A
lengththat runs past the end returns the rest of the text, without an error:substring(4, 10, body)onnodintereturnsnte.