Similar to the example here: Example: Color coded group header with aggregate
I am trying the group header text in the list view to show the number of tasks that are NOT 'Completed' in the 'Status' choice column.
Here's my JSON, can someone help me out with this?
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"groupProps": {
"hideFooter": true,
"headerFormatter": {
"elmType": "div",
"style": {
"flex-wrap": "wrap",
"display": "flex",
"box-sizing": "border-box",
"padding": "4px 8px 5px 8px",
"border-radius": "6px",
"align-items": "center",
"white-space": "nowrap",
"overflow": "hidden",
"margin": "1px 4px 4px 1px"
},
"attributes": {
"class": "ms-bgColor-neutralQuaternary"
},
"children": [
{
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"padding": "5px 5px 5px 5px",
"font-weight": "500"
},
"txtContent": "@group.fieldData.displayValue"
}
]
},
{
"elmType": "div",
"forEach": "iterator in @currentField",
"children": [
{
"elmType": "div",
"style": {
"display": "=if([$iterator.columnDisplayName] == 'Status' && [$iterator.value] != 'Completed', 'flex', 'none')",
"flex-direction": "row",
"justify-content": "center"
},
"children": [
{
"elmType": "div",
"txtContent": "=' pending tasks: ' + Number(@group.count - Number([$iterator.value]))",
"style": {
"font-weight": "500"
}
}
]
}
]
}
]
}
}
}