How to Enable Column Formatting in SharePoint

Loading

Column formatting in SharePoint allows users to customize how data appears in lists and libraries without changing the actual content. It enhances visual appeal, usability, and data readability by applying colors, icons, and conditional formatting based on column values.

This guide will cover:
What is Column Formatting?
How to Enable and Apply Column Formatting
Examples of Column Formatting
Best Practices for Column Formatting


1. What is Column Formatting in SharePoint?

Column formatting in SharePoint uses JSON (JavaScript Object Notation) to apply custom styles to list and library columns. It allows users to:

Highlight important data – Use colors, bold text, and icons.
Improve data readability – Format status fields (e.g., Approved, Pending, Rejected).
Enhance user experience – Display progress bars, buttons, and images.
Apply conditional logic – Change formatting based on specific values.

No coding skills required! SharePoint provides an easy-to-use editor for JSON formatting.


2. How to Enable Column Formatting in SharePoint

Step 1: Open the SharePoint List or Library

1️⃣ Navigate to the SharePoint site containing the list or library.
2️⃣ Open the List or Library where you want to format a column.


Step 2: Access Column Settings

1️⃣ Click the column header (e.g., “Status,” “Priority”).
2️⃣ Select “Column settings” > “Format this column.”
3️⃣ The Column Formatting pane appears on the right side.


Step 3: Choose a Formatting Option

Prebuilt formatting options – SharePoint provides built-in styles.
Custom formatting – Click “Advanced mode” to apply JSON formatting.


Step 4: Apply JSON Column Formatting

1️⃣ In Advanced mode, enter or paste JSON code.
2️⃣ Click Preview to see how it looks.
3️⃣ Click Save to apply the formatting.

Example 1: Color-Coded Status Column

jsonCopyEdit{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "background-color": "=if([$Status] == 'Approved', 'green', if([$Status] == 'Pending', 'yellow', 'red'))",
    "color": "white",
    "padding": "5px",
    "border-radius": "3px"
  },
  "children": [
    {
      "elmType": "span",
      "txtContent": "[$Status]"
    }
  ]
}

How it works:
✔ If the status is Approved, it appears Green.
✔ If the status is Pending, it appears Yellow.
✔ If the status is Rejected, it appears Red.


3. More Examples of Column Formatting

Example 2: Priority Column with Icons

jsonCopyEdit{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "span",
  "children": [
    {
      "elmType": "span",
      "attributes": {
        "iconName": "=if([$Priority] == 'High', 'Warning', if([$Priority] == 'Medium', 'Info', 'CheckMark'))",
        "style": {
          "color": "=if([$Priority] == 'High', 'red', if([$Priority] == 'Medium', 'orange', 'green'))"
        }
      }
    },
    {
      "elmType": "span",
      "style": {
        "padding-left": "5px"
      },
      "txtContent": "[$Priority]"
    }
  ]
}

How it works:
High priorityRed warning icon
Medium priorityOrange info icon
Low priorityGreen checkmark


Example 3: Progress Bar for Percentage Column

jsonCopyEdit{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "width": "100%",
    "background-color": "#f3f3f3",
    "border-radius": "5px",
    "padding": "2px"
  },
  "children": [
    {
      "elmType": "div",
      "style": {
        "width": "[$Progress]%",
        "background-color": "blue",
        "color": "white",
        "text-align": "center",
        "border-radius": "5px"
      },
      "txtContent": "[$Progress]%"
    }
  ]
}

How it works:
✔ Displays a blue progress bar based on percentage values.
✔ Great for tracking project completion or task progress.


4. Best Practices for Column Formatting

Use meaningful formatting – Avoid excessive colors or complex layouts.
Test before applying to production lists – Use Preview mode.
Apply conditional logic – Highlight critical data (e.g., overdue tasks).
Refer to Microsoft’s documentation – Find updates on JSON schemas.
Ensure formatting enhances usability – Avoid formatting that makes data harder to read.

Leave a Reply

Your email address will not be published. Required fields are marked *