Agregation
Aggregates a data array with a statistical operation: count, sum, avg, min, max, group, distinct.
Parameters
| Parameter | Type | Required | Variable | Description |
|---|---|---|---|---|
operation | choice (count, sum, avg, min, max, group, distinct) | Yes | No | Aggregation operation to perform on the data. |
inputArray | dynamic value | No | Yes | Input array on which to apply the aggregation. |
field | text | No | Yes | Field to aggregate on (required for sum, avg, min, max). |
groupBy | array | No | No | Grouping fields. Allows computing the aggregation per group. |
outputVariable | text | No | No | Output variable name containing the aggregation result. |
Parameters marked Variable = Yes accept the
{{blockName.field}}syntax.
Output
Output variable : aggregateResult
{
"result": "..."
}
Example
Count the number of active elements.
Input :
{"items": [{"status": "active"}, {"status": "inactive"}, {"status": "active"}]}
Output :
{"result": 3}
Tip
{{aggregateResult.result}} contains the aggregation result. Type varies by operation: number for count/sum/avg/min/max, array for group/distinct.