---
title: Formula min – Lowest Numeric Value in Nodinite Search Field Expressions
description: The min function in the Nodinite Formula plugin returns the lowest numeric value in the content. Syntax, the unique parameter, and tested examples with xPath, jsonPath, and csv in message context.
---

# <i class="fal fa-function" aria-hidden="true"></i> Formula - Min

The `min` function, one of the Math functions in the [Formula][] plugin for [Search Field Expressions][], returns the lowest numeric value in the content.

![Lowest, highest, and average line total of an order with min, max, and avg, animated walkthrough (7.12)][3]  
*Animated walkthrough: on the Order Entry XML of order ORD-10011 in the [Order-to-Cash demo][], with the line totals 399.80, 498.00, and 125.00, `min` returns `125.00`, [max][] returns `498.00`, and [avg][average] returns the unrounded average `340.9333333333333333333333333`.*  

## <i class="fal fa-code" aria-hidden="true"></i> Syntax

```text
min(content [, unique])
```

### Parameters

| Parameter | Required | Description |
| --- | --- | --- |
| `content` | ✅ Yes | The numeric values to compare: [body][], [context][Context], or another Formula function such as [xPath][], [jsonPath][], or [csv][]. |
| `unique` | ❌ No | Unquoted `true` or `false`; default `true` for this function. `false`: a value that appears several times counts every time. `true`: identical values count once. Values are compared as text, so `100` and `100.00` are different values. A quoted `'true'` is an error. |

### Returns

* One number: the lowest numeric value in `content`.
* Values are compared as numbers, so `8` is lower than `42` even when the values are JSON strings (see [Example 2](#example-2-lowest-value-extracted-from-json)).

Quoting, nesting, and how `content` is resolved are described in the [Formula language rules][].

## <i class="fal fa-list-ol" aria-hidden="true"></i> Examples

### Example 1: Lowest order amount in an XML message

#### Input

Message Body:

```xml
<ns0:Orders xmlns:ns0="SupplyChain.Schemas/1.0">
  <Order>
    <Id>1337</Id>
    <Amount>666</Amount>
    <City>New York</City>
    <Partner>QWNtZQ==</Partner>
  </Order>
  <Order>
    <Id>1338</Id>
    <Amount>42</Amount>
    <City>Paris</City>
    <Partner>QWNtZQ==</Partner>
  </Order>
</ns0:Orders>
```

#### Formula

```text
min(xPath('Orders/Order/Amount', body))
```

#### Result

```text
42
```

[xPath][] extracts the amounts `666` and `42`; the lowest is `42`.

![Test Expression tab: min(xPath('Orders/Order/Amount', body)) on orders with amounts 666 and 42 returns 42 (7.12)][ex1]  
*The amounts are compared as numbers, so `42` is lower than `666`.*  

### Example 2: Lowest value extracted from JSON

#### Input

Message Body:

```text
{a:[{b:'1337'},{b:'8'},{b:'42'}]}
```

#### Formula

```text
min(jsonPath('a[*].b', body))
```

#### Result

```text
8
```

![Test Expression with min of jsonPath over every b in the array a, on a JSON array, returning 8 (7.12)][1]  
*[jsonPath][] extracts `1337`, `8`, and `42`; the lowest is `8`.*  

### Example 3: Lowest value in a CSV column stored in message context

#### Input

Message Context:

| Key | Value |
| --- | --- |
| `Ids` | the CSV text below |

```text
"face","suit","value"
"king","spades","13"
"queen","spades2","12"
#"jack","spades3","666"
"ten","spades4","10"
```

#### Formula

```text
min(csv(1, ',', 2, '#', context('Ids')))
```

#### Result

```text
10
```

![Test Expression with min(csv(1,',',2,'#',context('Ids'))) on CSV text in the context key Ids, returning 10 (7.12)][2]  
*[csv][] skips the header row, reads column `2` (the `value` column, counted from 0), and ignores the row that starts with `#`; the lowest of `13`, `12`, and `10` is `10`.*  

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Add or manage Search Field][]  
* <i class="fal fa-flask" aria-hidden="true"></i> [Test Your Expression][]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Add or manage Log View][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-calculator" aria-hidden="true"></i> [avg][average]  
* <i class="fal fa-hashtag" aria-hidden="true"></i> [count][]  
* <i class="fal fa-text-width" aria-hidden="true"></i> [length][]  
* <i class="fal fa-arrow-up-wide-short" aria-hidden="true"></i> [max][]  
* <i class="fal fa-circle-half-stroke" aria-hidden="true"></i> [round][]  
* <i class="fal fa-plus" aria-hidden="true"></i> [sum][]  
* <i class="fal fa-function" aria-hidden="true"></i> [Formula][]  
* <i class="fal fa-scroll" aria-hidden="true"></i> [Formula language rules][]  
* <i class="fal fa-puzzle-piece" aria-hidden="true"></i> [Search Field Expressions][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Math/MinValueJSONBodyString.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Math/MinFromCSVContext.png
[3]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Math/Formula_MinMaxAverage.gif

[Add or manage Log View]:https://docs.nodinite.com/administration/log-management/log-views/features/add-or-manage-log-view/
[Add or manage Search Field]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/
[average]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/math/average/
[body]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/body/
[Context]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/context/
[count]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/math/count/
[csv]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/csv/
[ex1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Math/min_Example1.png
[Formula]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/
[Formula language rules]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/#fa-scroll-formula-language-rules
[jsonPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/jsonpath/
[length]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/math/length/
[max]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/math/max/
[Order-to-Cash demo]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/generate-o2c-demo-data/
[round]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/math/round/
[Search Field Expressions]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[sum]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/math/sum/
[Test Your Expression]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/#test-your-expression
[xPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/xpath/