Formula - substring
The substring
Formula in Nodinite lets you extract any part of a string from message body, context, or even nested formulas. This page provides a clear, step-by-step guide with practical examples, so you can quickly master string slicing for your integration needs.
✅ Extract any part of a string from message body or context
✅ Use with nested formulas for advanced scenarios
✅ Enhance data quality and search field results in Nodinite
What is the substring formula?
The substring
function extracts a specific part of a string, starting at a given index and for a given length. You can use it on message body, context, or the result of another formula.
How does it work?
Each example below is structured in three clear steps:
- Input – The data or context you start with
- Formula – The substring expression you use
- Result – The output you get
Examples
Example 1: Extract from message body
Input:
nodinite
Formula:
substring(0,4,body)
Result:
nodi
Extracts the first four characters from the message body
Visual example of substring from message body
Example 2: Extract from context value
Input:
Amazing Function
Formula:
substring(0,7,context('id'))
Result:
Amazing
Extracts the first seven characters from the context value
Visual example of substring from context value
Example 3: Extract from nested formula result
Input:
[ { "name": "column" }, { "name": "olive" } ]
Formula:
substring(0,2,jsonpath('$..name',body))
Result:
Co, ol
Extracts the first two characters from each name returned by the jsonpath function
Visual example of substring from nested formula
Usage Tips
- Use with any Content that returns text
- Works with jsonpath, xpath, or other formula functions
- Only use on small messages—this function loads the entire message into RAM
Next Step
Add or manage Search Fields
Add or manage Log Views