Formula - Max
Quickly find the maximum value in your data using the Max Formula in Nodinite. This page provides clear, real-world examples with a new, easy-to-read layout that separates input, formula, and result.
✅ Instantly get the maximum value from message body, Context, or nested formulas
✅ Use with XML, JSON, CSV, or plain text data
✅ Enhance your integration analytics with unique, reliable results
🎯 Design Note: The max() function returns the highest value extracted from your data.
What does the Max formula do?
The max() formula returns the highest value extracted from your data. Use it to analyze message payloads, context values, or results from other formulas in your log views and search fields.
Syntax
The max() formula returns the highest numeric value extracted from your data.
Common patterns:
max(body)
Find maximum value in message body.
max(xpath('//Amount', body))
Find maximum of specific XML elements. (See Example 1)
max(jsonpath('$..price', body))
Find maximum of specific JSON values. (See Example 2)
max(csv(columnIndex, delimiter, skipLines, commentChar, context('ContextKey')))
Find maximum from CSV data in context. (See Example 3)
Returns: The highest numeric value found.
Examples
Below are practical examples showing exactly what input is used, the formula expression, and the resulting output.
Example 1: XML Message Body
Input
<ns0:Orders xmlns:ns0="SupplyChain.Schemas/1.0">
<Order>
<Id>1337</Id>
<Amount>666</Amount>
<City>Grums</City>
<Partner>QWNtZQ==</Partner>
</Order>
<Order>
<Id>1338</Id>
<Amount>42</Amount>
<City>Karlstad</City>
<Partner>QWNtZQ==</Partner>
</Order>
</ns0:Orders>
Formula Expression - Example 1
max(xpath('Orders/Order/Amount', body))
Result - Example 1
666

The result is 666 because it is the largest value in the XML body.
Example 2: JSON Message Body
Input - Example 2
{"a":[{"b":"1337"},{"b":"8"},{"b":"42"}]}
Formula Expression - Example 2
max(jsonpath('a[*].b', body))
Result - Example 2
1337

The result is 1337 because it is the largest value in the JSON array.
Example 3: CSV in Message Context
Input - Example 3
"face","suit","value"
"king","spades","13"
"queen","spades2","12"
#"jack","spades3","666"
"ten","spades4","10"
Formula Expression - Example 3
max(csv(1,',',2,'#',context('Ids')))
Result - Example 3
13

Example of max() formula extracting the highest value from CSV data stored in message context, ignoring the commented-out row.
Features
- Get the maximum value from any Content
- Works with XML, JSON, CSV, plain text, or any valid formula plugin
- Returns the maximum of unique values only
- Ideal for integration analytics and data validation in Nodinite
Important
This plugin loads the entire message into RAM. For best performance, use it only on small messages.
How to use the Max formula
Syntax
- From Message Body:
max(body, [bool unique = true]) - From Message Context:
max(context('MessageContextKey'), [bool unique = true]) - From Nested Formula:
max(SomeOtherFormula(Content), [bool unique = true])
Next step
Related Topics
- Expression Type Plugins are used in Search Fields
- What are Search Fields?
- What are Search Field Expressions?
- What are Message Types?
- What are Log Views?
- Other Math formulas: average, count, length, min, sum