Min Array
This node finds the minimum value in an array.
The Min Array node scans an array to find the smallest element.
The Min Array node takes an array as input and returns the minimum value found within it. It supports arrays of numbers (finding the smallest number), strings (finding the first alphabetical value), and objects (using a key path).
| Data | Description |
|---|
| Array | The array to scan. Can contain numbers, strings, or objects. |
Object Options
| Data | Description |
|---|
| Key Path | Required if the array contains objects. Specifies the property path to compare (e.g., "cost"). |
Actions
| Signal | Description |
|---|
| Do | Triggers the calculation. The result is updated only when this signal is received. |
Outputs
Data
| Data | Description |
|---|
| Minimum | The smallest value found in the array. |
Signals
| Signal | Description |
|---|
| Done | Triggered when the calculation is successfully completed. |
Usage
Use this node to find valleys, lowest prices, or starting boundaries.
Example Use Cases
- Best Price: Find the lowest price in a list of product objects.
Array: Products.
Key Path: "price".
- Data Analysis: Find the lowest value in a dataset.
- Alphabetical Sort: Find the "first" word in a list (e.g., "Apple" < "Zebra").
Detailed Behavior
- Numeric Arrays: Uses
Math.min() logic.
- String Arrays: Sorts alphabetically and returns the first item.
- Object Arrays: Extracts values using
Key Path before comparing.
- Empty Array: Returns 0 if the array is empty.
Troubleshooting
- Result is 0: If the array is empty, the result defaults to 0.