Microsoft SharePoint is a platform that allows its users to create, store, share, and manage digital information. One of the best features in SharePoint is its ability to color code various content types or data fields. Color coding offers an efficient way to visually organize and differentiate different kinds of content. You can color code your calendar for example. Color coding can be done with CSS as well.
Here’s a comprehensive guide on how to incorporate color coding in Microsoft SharePoint. This tutorial applies to SharePoint Online, SharePoint 2013, SharePoint 2016, and SharePoint 2019 versions.
Step 1: Preconditions:
In your SharePoint list, ensure that you have a ‘Choice’ or ‘Yes/No’ column. The color coding hinges on these fields.
Step 2: Creating a JSON Formatting Template:
For color coding in SharePoint, we use JSON (JavaScript Object Notation). JSON is a text-based data exchange format that enables us to create custom column formatting.
Create a JSON formatting template that matches your color-coding needs. SharePoint presents various column formatting templates that you can choose from, modify, and apply.
Sample JSON:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if(@currentField == 'Choice1', '#ff0000', if(@currentField == 'Choice2', '#00ff00', '#0000ff'))"
}
}
Here “Choice1”, “Choice2”, etc., are the Choice field values. You can replace them with your actual values. The color-coding, #ff0000, for example, represents the color red. You can replace ‘#ff0000’, ‘#00ff00’, and ‘#0000ff’ with your preferred colors.
Step 3: Applying the JSON Formatting Template:
Once you’re done creating the JSON formatting template, navigate to the list that you want to color code in SharePoint.
3.1. Hover over the column header for the ‘Choice’ or ‘Yes/No’ column.
3.2. Click on the dropdown menu (A small arrow appears at the right end when the mouse pointer hovers over it).
3.3. Select ‘Column settings’
3.4. Choose ‘Format this column’
3.5. A dialog box appears towards the right side of the page. Select ‘Advanced mode’
3.6. Paste your created JSON format here and click on “Save”.
Step 4: Review Your Changes:
After you’ve saved the formatting template, the SharePoint list should automatically refresh, and your chosen column will be color-coded as per the conditions you’ve defined in the JSON template.
You have successfully added color coding to your SharePoint list! This can greatly enhance the clarity and ease-of-use of your list, making data interpretation a breeze. Happy coding!
Remember, SharePoint color-coding isn’t just about making your lists brighter and more colorful; it’s a powerful tool to quickly and efficiently make sense of your data. With color-coding, you can quickly visually differentiate list items based on your chosen parameters.
Leave a Reply