Forum Discussion

jellybeancooper's avatar
jellybeancooper
Brass Contributor
Jan 16, 2024
Solved

How do you change the color of the second grouped item header in a list view

I have a list that is grouped by Building and then by Room. I can use json to change the color of the headers as follows:     "groupProps": { "hideFooter":true, "headerFormatter": ...
  • ThomasAkalowski's avatar
    Jan 16, 2024

    jellybeancooper

     

     You can use a condition on the field name for this.

     

      "groupProps": {
        "hideFooter": true,
        "headerFormatter": {
          "elmType": "div",
          "attributes": {
            "class": "sp-row-card"
          },
          "style": {
            "background-color": "=if(@group.columnDisplayName == 'Building','blue','lightblue')",
            "color": "white"
          }
        }
      }