List Max
Find the maximum numeric value in a list. Accepts an array of numbers or numeric strings and returns the largest value along with its index. Useful for finding highest prices, largest balances, top values, etc.
Built-in action Built In
Find the maximum numeric value in a list. Accepts an array of numbers or numeric strings and returns the largest value along with its index. Useful for finding highest prices, largest balances, top values, etc.
At a Glance
| Field | Value |
|---|---|
| Action ID | list-max |
| Category | Built In |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | utility, transformer, list, max, maximum, aggregate, math |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
values | array | Yes | Array of numbers or numeric strings to find the maximum of. Supports workflow variables like {{node.result.prices}}. |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
result | string | Yes | The maximum value as a string. |
index | number | Yes | Zero-based index of the maximum value in the original array. |
Examples
json{ "type": "list-max", "payload": { "values": [ 10, 5, 20, 3, 15 ] }, "children": []}
bashcurl -X POST "https://api.b3os.org/v1/actions/list-max/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "values": [ 10, 5, 20, 3, 15 ] }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
