Skip to content
Documentation
Updated 2 minutes to read
Markdown

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

Keep only the date of an order with substring around jsonPath, animated walkthrough (7.12)
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.

substring(startIndex, length, content)
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.

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.

Example 1: Take the first four characters of the message body

Section titled “Example 1: Take the first four characters of the message body”
nodinte
substring(0, 4, body)
nodi

Test Expression tab: substring(0, 4, body) returns 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
substring(0, 7, context('id'))
Amazing

Test Expression tab: substring(0, 7, context('id')) returns Amazing for the context value Amazing Function
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"}
]
substring(0, 2, jsonPath('$..name', body))
co
ol

Test Expression tab: substring on two jsonPath values returns co and ol
jsonPath returns two values, and substring cuts each one: two unique matches.

  • A startIndex past the end of the text gives no value: substring(10, 4, body) on nodinte shows the warning The Expression yields no result.
  • A length that runs past the end returns the rest of the text, without an error: substring(4, 10, body) on nodinte returns nte.

...

Version:
Release date: N/A
Loading...

Explore Nodinite for 30 days – completely free

  • Find out why this is the leading O&M software
  • Prove your business case
  • Test the self-service for the business side

Loading...

See how Nodinite resolves your technical issues, in a LIVE Demo!

Once you submit this request:

  • We will give you a short call to understand the issues you want to tackle.
  • Understand solutions you have tried and why were you not happy with them.
  • Book a convenient slot for a LIVE demo!

Loading...