I'm trying to do some formatting of my document library. I'm specifically trying to format when I've grouped by a column, this column is a lookup column to another list.
This is the code I'm using.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"groupProps": {
"hideFooter":true,
"headerFormatter": {
"elmType": "div",
"style": {
"flex-wrap": "wrap",
"background-color":"lightgray",
"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": "'sp-field-borderAllRegular sp-css-borderColor-neutralSecondary'"
},
"children": [
{
"elmType": "div",
"children": [
{
"elmType": "div",
"style": {
"display": "flex",
"flex-direction": "row",
"justify-content": "center"
},
"children": [
{
"elmType": "div",
"txtContent": "= @group.count + ' Document(s)'",
"style": {
"padding": "5px 5px 5px 5px",
"font-weight": "500"
}
}
]
}
]
},
{
"elmType": "div",
"children": [
{
"elmType": "div",
"style": {
"display": "flex",
"flex-direction": "row",
"justify-content": "center"
},
"children": [
{
"elmType": "div",
"txtContent": "= 'Agent: ' + @group.fieldData.displayValue",
"style": {
"padding": " ",
"font-weight": "500"
}
}
]
}
]
}
]
}
}
}
This is giving me an [object Object]
result which is really confusing me, I can only assume this is due to it being a lookup column.
Any help would be greatly appreciated, many thanks.