How to Add Custom Colors to SharePoint Managed Metadata Values
Question details
The user needs to apply different background and text colors to 28 distinct managed metadata portfolio values in a SharePoint document library.

- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Customizing the visual display of a document library that uses managed metadata tags for better portfolio categorization and visual distinction.
- Observed behavior
- The managed metadata terms are currently displaying in standard plain text, and a method is needed to visually distinguish them using custom colors without requiring heavy coding.
Before customizing your SharePoint list, ensure you have at least 'Design' or 'Edit' permissions for the document library and that your managed metadata column is fully populated.
Apply JSON Column Formatting for Managed Metadata
Use SharePoint's built-in column formatting feature to apply conditional styling based on metadata values using JSON.
SharePoint allows users to customize how fields are displayed using JSON code. This method is highly effective for applying unique background and text colors to managed metadata columns, even when dealing with multiple conditions.
Navigate to your SharePoint document library, click on the header of the managed metadata column, and select 'Column settings' followed by 'Format this column'.
In the formatting pane on the right side of the screen, click 'Advanced mode' at the bottom to switch from the standard design interface to the JSON input box.
Paste your custom JSON code. You will need to use nested 'if' statements to evaluate the column value (e.g., using `[$YourColumnName.Label]`) and apply the desired `background-color` and `color` CSS styles for each of your 28 portfolio terms.
Click 'Save' at the bottom of the formatting pane. Review your document library to ensure each portfolio value now dynamically displays its assigned background and text color.

Enhance Your Document Workflow with WPS Office
While SharePoint effectively manages your cloud libraries, editing the actual Word, Excel, and PowerPoint files stored within them is easier with WPS Office. It provides a free, lightweight, and highly compatible alternative to Microsoft Office for all your document needs.
- 1. Download WPS Office: Visit the official WPS website to download and install the free WPS Office suite on your device.
- 2. Open Your Documents: Download your files from SharePoint and open them directly in WPS Office for editing.
- 3. Edit and Save: Make your changes using the highly compatible tools, then save and re-upload the finalized documents back to your SharePoint library.

Frequently Asked Questions
Can I format SharePoint metadata columns without using JSON?
Basic 'Choice' columns can often be formatted using the visual UI (Design mode) in SharePoint. However, Managed Metadata columns are more complex and typically require Advanced mode (JSON) to apply specific conditional colors to different term labels.
Why is my JSON column formatting not applying to the metadata?
Ensure you are referencing the correct internal column name. For managed metadata, you usually must append '.Label' to the column name in your JSON condition (for example: `[$Portfolio.Label] == 'YourTermName'`) for the formatting rules to trigger correctly.
Is there a limit to how many conditions I can add in SharePoint JSON formatting?
While there is no strict technical limit that prevents 28 conditions, having highly complex JSON with dozens of nested 'if' statements can become difficult to maintain and troubleshoot. Ensure your JSON syntax (especially commas and brackets) is perfectly formatted to prevent rendering errors.




