Actions6
Overview
This node operation performs a summary calculation on usage data records. It totals specified numeric fields across the data and optionally groups the summary by one or more fields. It can also include the original source data records in the output. This is useful for scenarios where you need to aggregate usage metrics such as costs, quantities, or sales amounts, grouped by categories like product ID or region, to generate summarized reports or billing summaries.
Use Case Examples
- Summarizing total cost and quantity fields from usage records grouped by product ID.
- Generating a summary report of usage data with totals for specified fields without grouping.
- Including original usage records alongside the summary totals for detailed analysis.
Properties
| Name | Meaning |
|---|---|
| Usage Data | Expression or JSON that resolves to the usage records to summarize. Accepts arrays or single objects. |
| Fields to Total | Comma-separated list of field names to total. For each field, a 'total_[field name]' will be included in the summary output. |
| Group By Fields | Optional comma-separated list of fields to group the summary by (e.g., product_id, region). |
| Include Source Data | Boolean flag indicating whether to include the original source data records in the summary output. |
Output
JSON
total_field name- The total sum of the specified field across the usage data.
groupByField- The value of the field used to group the summary, if grouping is applied.sourceData- The original usage data records included if 'Include Source Data' is true.
Dependencies
- No external API dependencies are required for this operation.
Troubleshooting
- Ensure the 'Usage Data' input is a valid JSON array or object representing usage records.
- Verify that the 'Fields to Total' are correctly named fields present in the usage data.
- If grouping by fields, confirm that the field names exist in the usage data records.
- If 'Include Source Data' is enabled, be aware that the output size may increase significantly.