Forum Discussion
Custom Coloring for SharePoint List Pills
1. Use default column formatting (no code required)
Scenario: Simple color sorting
Go to list → select the column you want to modify
Click on "Column Settings" → "Format this Column"
Use preset "Label Styles" (red/yellow/green, etc. base colors)
2. Advanced color customization (JSON formatting)
Scenario: Fully customizable colors
Select "Advanced Mode" in the Column Formatting interface
Paste the following JSON template (modify color values and conditions):
json
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
" style": {
"background-color": {
"operators": "?" ,
"operands": [
{ "operator": "==", "operands": ["[$Status]", "Approved"] },
"#4CAF50", // green
{ "operator": "==", "operands": ["[$Status]", "Pending "] },
"#FFC107", // yellow
"#F44336" // default red
]
},
"color": "#ffffff",
"padding": "4px 8px",
"border-radius": "16px",
"display": "inline-block"
},
" txtContent": "@currentField"
}
3. Dynamically set colors via Power Automate
Scenario: Need to change colors automatically based on business rules
Create Automation Flow:
Trigger Condition: "When an item is created or modified"
Add Action: "Send HTTP request" to SharePoint API
Include colors in request body Logic requires administrator privileges