Skip to main content

Agregation

Aggregates a data array with a statistical operation: count, sum, avg, min, max, group, distinct.

Parameters

ParameterTypeRequiredVariableDescription
operationchoice (count, sum, avg, min, max, group, distinct)YesNoAggregation operation to perform on the data.
inputArraydynamic valueNoYesInput array on which to apply the aggregation.
fieldtextNoYesField to aggregate on (required for sum, avg, min, max).
groupByarrayNoNoGrouping fields. Allows computing the aggregation per group.
outputVariabletextNoNoOutput 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.