I have a list where I group rows and use aggregate() to count specific columns. The issue I'm facing is that the resulting column names all show as "Total Value," which makes it difficult to differentiate between them.
I would like each aggregated column to have a unique name in group header. For example, I want to rename the columns after aggregation based on their purpose or source.
The internal names of the columns I’m working with are:
- ITBreached
- BusinessBreached
- TeamBreached
How can I customize the output column names so that they reflect the specific data they represent, instead of all being labelled the same?
Here’s a simplified version of my current code:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "groupProps": { "hideFooter": false, "headerFormatter": { "elmType": "div", "style": { "display": "flex", "flex-direction": "column", "box-sizing": "border-box", "padding": "4px 8px", "border-radius": "6px", "overflow": "hidden", "margin": "1px 4px 4px 1px" }, "children": [ { "elmType": "div", "style": { "display": "flex", "align-items": "left", "margin-bottom": "5px", "color": "red" }, "children": [ { "elmType": "span", "style": { "max-width": "24px", "max-height": "24px", "margin-left": "8px" } }, { "elmType": "div", "children": [ { "elmType": "div", "txtContent": "= '(Order Count: ' + @group.count + ')'", "style": { "font-weight": "500", "padding": "4px" } } ] }, { "elmType": "div", "children": [ { "elmType": "div", "txtContent": "= @group.fieldData.displayValue", "style": { "font-weight": "500", "padding": "4px" } } ] } ] }, { "elmType": "div", "style": { "display": "flex", "align-items": "center" }, "children": [ { "forEach": "currentValue in @aggregates", "elmType": "div", "txtContent": "= '(Total value: ' + [$currentValue.value] + ')'", "style": { "display": "inline-flex", "margin-right": "8px" } } ] } ] } } } 