How to remove [object Object] from grouped list, while hiding group count?

Boyte, William 20 Reputation points
2024-03-22T17:49:25.91+00:00

I have created a list and when I enter the JSON code below. I get the following showing on my list and I cannot figure out how to correct it. The goal is I want the assigned User name to remain, but I want the group count to not be displayed or hidden. Thanks!

[object Object] User Name

{

"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",

"groupProps": {

"headerFormatter": {

"elmType": "div",

"style": {

"padding-left": "12px",

"font-size": "16px",

"font-weight": "400",

"cursor": "pointer",

"outline": "0px",

"white-space": "nowrap",

"text-overflow": "ellipsis"

},

"children": [

{

"elmType": "div",

"children": [

{

"elmType": "span",

"style": {

"padding": "5px 5px 5px 5px"

},

"txtContent": "@group.fieldData.displayValue"

}

]

},

{

"elmType": "span",

"txtContent": "=@group.fieldData.title",

"attributes": {

"title": "=@group.fieldData.title"

},

"style": {

"padding": "5px 5px 5px 5px"

}

},

{

"elmType": "div",

"children": [

{

"elmType": "div",

"style": {

"display": "flex",

"flex-direction": "row",

"justify-content": "center"

},

"children": [

{

"elmType": "div",

"txtContent": "@group.count.hideValue"

}

]

}

]

}

]

}

}

}

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,565 questions
{count} votes

Accepted answer
  1. Mzoughi Ilyes 80 Reputation points
    2024-03-24T02:36:50.0133333+00:00

    Hi Boyte, William,

    I assume that your assigned field is not a multi-user so you can use this json code to achieve your requirement

    {
     "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
    "groupProps": {
    "headerFormatter": {
    "elmType": "div",
    "style": {
    "padding-left": "12px",
    "font-size": "16px",
    "font-weight": "400",
    "cursor": "pointer",
    "outline": "0px",
    "white-space": "nowrap",
    "text-overflow": "ellipsis"
     },
    "children": [
     {
    "elmType": "div",
    "children": [
     {
    "elmType": "span",
    "style": {
    "padding": "5px 5px 5px 5px"
     },
    "txtContent": "@group.fieldData.title"
     }
     ]
     }
     ]
     }
     }
    }
    

    User's image

    Best regards,

    IM

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful