How to fix sharepoint list "group by feature" display error

Arise Pizhayut 0 Reputation points
2024-07-24T04:37:59.7533333+00:00

in Sharepoint List, using group by and format view using JSON will show as picture below. Screenshot 2567-07-24 at 11.33.46

but when using for a while, the group by display text change become picture below. all group became same name. even the sub-group also changed to be the same.

Screenshot 2567-07-24 at 11.33.19

here's the JSON code, i used:

{

"$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": "=if(@group.columnDisplayName == 'Project Status', 'sp-css-backgroundColor-BgCornflowerBlue','sp-css-backgroundColor-BgSage')"

},

"children": [

{

"elmType": "div",

"children": [

{

"elmType": "div",

"style": {

"display": "flex",

"flex-direction": "row",

"justify-content": "center"

},

"children": [

{

"elmType": "div",

"style": {

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

"font-weight": "500",

"display": "=if(@group.columnDisplayName == 'Main Platform', 'flex', 'none')"

},

"txtContent": "@group.fieldData.lookupValue"

},

{

"elmType": "div",

"style": {

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

"font-weight": "500",

"display": "=if(@group.columnDisplayName == 'Project Status', 'flex', 'none')"

},

"txtContent": "@group.fieldData"

}

]

}

]

},

{

"elmType": "div",

"children": [

{

"elmType": "div",

"style": {

"display": "flex",

"flex-direction": "row",

"justify-content": "center"

},

"children": [

{

"elmType": "div",

"txtContent": "=' (' + @group.count + ')'",

"style": {

"padding": " ",

"font-weight": "500"

}

}

]

}

]

}

]

}

}

}

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,817 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 47,296 Reputation points Microsoft Vendor
    2024-07-24T08:55:44.7066667+00:00

    Whether Project Status is a text column and Main Platform is a look up column?

    Except JSON codes, have you done some other settings in the view?

    I did a test in my SharePoint list, JSON codes work well.

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.