Sensitivity Label (Column Formatting)
Overview
- Shows the confidentiality level as a colored tag with a lock icon
- Each level gets its own color – Public, Internal, Confidential, Restricted
- Makes handling expectations obvious at a glance
- Reads the choice column directly, so it stays in sync
- Applied as column-formatting JSON, so it changes nothing about the files
- Works on any sensitivity choice column
Common Use Cases
- Confidential document libraries
- HR and legal repositories
- Finance and board materials
- Customer or partner data
- Security documentation
- Any library needing a handling label
How to Apply JSON Formatting
1. Open your document library and add a Choice column named Sensitivity (Public, Internal, Confidential, Restricted).
2. On the Sensitivity column, open the column header menu, choose Column settings, then Format this column.
3. Switch to Advanced mode, paste the JSON below, and click Save.
JSON Code – Select, Copy and Paste
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"display": "inline-flex",
"align-items": "center",
"justify-content": "center",
"box-sizing": "border-box",
"min-width": "=if(@currentField == '', '86px', '120px')",
"height": "26px",
"padding": "2px 10px",
"border-radius": "4px",
"background-color": "=if(@currentField == 'Public', '#e7f3e8', if(@currentField == 'Internal', '#eaf2fb', if(@currentField == 'Confidential', '#fde7e9', if(@currentField == 'Restricted', '#f7e5f6', '#f3f2f1'))))",
"border": "=if(@currentField == 'Public', '1px solid #b7dfba', if(@currentField == 'Internal', '1px solid #b9d7f0', if(@currentField == 'Confidential', '1px solid #f1aeb5', if(@currentField == 'Restricted', '1px solid #e3b7e8', '1px solid #d2d0ce'))))"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "=if(@currentField == '', 'TagUnknown', 'Lock')"
},
"style": {
"font-size": "12px",
"margin-right": "6px",
"color": "=if(@currentField == 'Public', '#0b6a0b', if(@currentField == 'Internal', '#0b5cab', if(@currentField == 'Confidential', '#c50f1f', if(@currentField == 'Restricted', '#7a1f8a', '#605e5c'))))"
}
},
{
"elmType": "span",
"style": {
"font-size": "12px",
"font-weight": "600",
"white-space": "nowrap",
"overflow": "hidden",
"text-overflow": "ellipsis",
"color": "=if(@currentField == 'Public', '#0b6a0b', if(@currentField == 'Internal', '#0b5cab', if(@currentField == 'Confidential', '#c50f1f', if(@currentField == 'Restricted', '#7a1f8a', '#605e5c'))))"
},
"txtContent": "=if(@currentField == '', 'No label', @currentField)"
}
]
}
Common Questions About the Sensitivity Label
What is the Sensitivity Label built with?
It is built with a standard SharePoint document library and a small piece of column-formatting JSON applied to a sensitivity choice column. There is no custom development, no SPFx solution, and no third-party tools. It is the kind of clean, maintainable formatting Greg Zelfond builds for teams that want clear handling labels without ongoing development overhead.
Is this the same as a Microsoft Purview sensitivity label?
No – this is a visual tag driven by a Choice column you control, which is simple to set up and adapt. It is not the same as Microsoft Purview sensitivity labels, which apply protection and encryption; this just makes a chosen level easy to read.
Does this design use any custom development or third-party tools?
No. It uses only out-of-the-box SharePoint column formatting, which Microsoft supports natively. That keeps it stable and easy to maintain, and nothing breaks when SharePoint is updated. Out-of-the-box is the only way Greg builds, so you can own and extend the design yourself for years.
If LookBook 365 is code-free and out-of-the-box, why does this example include JSON?
Because SharePoint formatting JSON is not custom code – it is a native configuration feature built into lists and libraries. It is declarative: it only describes how existing columns and views look, and cannot run scripts, reach external services, or change your data. Nothing is deployed and nothing breaks when Microsoft updates SharePoint, and you can edit or remove it anytime. That is why LookBook 365 treats it as out-of-the-box and low risk.
Can I use my own levels and colors?
Yes. The level-to-color map is a short list in the JSON, so you can rename levels, add new ones, or change the colors to match your classification scheme and brand.
Can Greg build this for our library?
Yes – this is exactly the kind of work Greg Zelfond does. As an independent SharePoint consultant and Microsoft MVP, he designs out-of-the-box list and library formatting like this so your team can read and maintain it without a developer. Reach out through the contact page to talk about your library.
