Fix SharePoint Grouped List Header Colors with JSON
Question details
The user needs to apply distinct background colors to SharePoint grouped list headers based on status values, but the current JSON code fails to differentiate statuses or display group values.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Customizing a grouped list view in SharePoint using JSON to visually track project or task statuses via color-coded headers.
- Observed behavior
- JSON formatting incorrectly assigns identical background colors to the 'In Progress' and 'Not Started' statuses, and completely fails to display the group text value.
Ensure you have 'Design' or 'Full Control' permissions for the SharePoint list, and keep a backup of your original JSON formatting code in a local text editor before making modifications.
Review JSON Conditions and Consult Microsoft Learn
Since group-header customization requires precise JSON syntax, verifying your conditional statements and seeking expert review is the most effective approach.
SharePoint list formatting relies heavily on exact matches for internal field names and status values. When statuses like 'In Progress' and 'Not Started' share a color, it typically means the conditional logic (such as nested 'if' statements) is falling back to a default color because the specific string values are not recognized.
Furthermore, customizing group headers via JSON overrides the default display, meaning you must explicitly define the group name property for the text to appear.
Navigate to your SharePoint list, click the view dropdown menu in the top right corner, and select 'Format current view'.
Click on 'Advanced mode' at the bottom of the formatting pane to access and edit the raw JSON code applied to the list.
Check the `groupProps` and `headerFormatter` sections of your JSON. Ensure you are using `@group.fieldData.displayValue` to render the group text, and verify that your conditional operators strictly separate the 'In Progress' and 'Not Started' text strings exactly as they appear in the column settings.
If the code still fails, copy your entire JSON snippet and post it on Microsoft Learn Q&A using the 'SharePoint Development' tag. SharePoint developers can quickly identify syntax errors and debug your custom code.

Looking for a Simpler Way to Manage Documents? Try WPS Office
While SharePoint handles advanced database lists and complex JSON coding, everyday document creation and team collaboration don't have to be complicated. WPS Office offers a free, lightweight, and incredibly intuitive alternative that works beautifully with all standard office file formats.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your Windows, Mac, or Linux operating system.
- 2. Install the Software: Run the installer and follow the quick on-screen instructions to set up the office suite in just a few minutes.
- 3. Open and Edit Seamlessly: Double-click any of your existing Microsoft Office documents to open, edit, and save them directly in WPS Office without losing any formatting.

Frequently Asked Questions
Why is my SharePoint group value not displaying in the formatted header?
When using custom JSON formatting for group headers, the default group name is hidden unless explicitly called. You must use `@group.fieldData.displayValue` or `@group.fieldData` within your `txtContent` property to display the actual text of the grouped item.
What causes conditional JSON formatting to apply the same color to different statuses?
This usually happens due to a syntax error, a typo in the exact status string (such as missing a space in 'In Progress'), or referencing the wrong internal column name, which causes the logic to fall back to the default 'false' formatting condition.
How do I find the correct internal name of a SharePoint column for JSON?
Go to List Settings, click on the column name you want to reference, and look at the URL in your web browser. The internal name is the text string immediately following 'Field=' at the very end of the URL.




