Format View of groups getting object object

Copper Contributor

Hello,

 

I'm trying to do some formatting of my document library.  I'm specifically trying to format when I've grouped by a column

 

 

 

 

 

 

{
    "$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"
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  }

 

 

 

But the above code is generating this [object Object] result and I cant work out how to resolve this

image.png

Any help would be greatly appreciated :)

2 Replies
So after some more looking into this, I think the reason im getting this outcome is that the column I am grouping on is a Lookup column. would that impact it?

Is it possible to overcome this?
try with
@group.fieldData.lookupValue
regards
m