Action that performs aggregation operations on arrays of data Supports grouping, counting, summing, averaging, and other statistical operations

Example

// Simple aggregation
await runAction({
ActionName: 'Aggregate Data',
Params: [{
Name: 'InputData',
Value: [
{ category: 'A', value: 10 },
{ category: 'A', value: 20 },
{ category: 'B', value: 15 }
]
}, {
Name: 'Aggregations',
Value: [
{ field: 'value', operation: 'sum', outputName: 'totalValue' },
{ field: 'value', operation: 'avg', outputName: 'avgValue' }
]
}]
});

// Group by aggregation
await runAction({
ActionName: 'Aggregate Data',
Params: [{
Name: 'InputData',
Value: salesData
}, {
Name: 'GroupBy',
Value: ['region', 'product']
}, {
Name: 'Aggregations',
Value: [
{ field: 'sales', operation: 'sum', outputName: 'totalSales' },
{ field: 'sales', operation: 'count', outputName: 'transactionCount' }
]
}]
});

Hierarchy (view full)

Constructors

Methods

  • Executes the action with the provided parameters.

    Parameters

    • params: RunActionParams<any>

      The action execution parameters including context

    Returns Promise<ActionResultSimple>

    Promise resolving to the action result

  • Aggregate with grouping (multiple results)

    Parameters

    • data: any[]
    • groupByFields: string[]
    • aggregations: any[]
    • includeEmptyGroups: boolean

    Returns any[]