How to Format SharePoint Columns with JSON

infographics with a text of How to Format SharePoint Columns with JSON

A project manager opens a SharePoint list to check which tasks need attention. The information is there, but completed, pending, and overdue items all look almost identical. Instead of spotting the important entries immediately, they have to read through rows and compare values one by one. 

This is where JSON column formatting becomes useful. In our work with SharePoint lists at Code Creators, we often use formatting to make existing list data easier to interpret without changing the values behind it. A status can stand out based on its value, an overdue date can draw attention, and users can understand what needs action without scanning every field manually.  

You also do not need to rebuild the list or create a custom application. SharePoint applies the JSON to how a column appears while keeping its stored value unchanged. In this article, you will learn how to use SharePoint column formatting JSON, understand the elements you need, and apply practical formatting to common list columns. 

What Is SharePoint Column Formatting with JSON?

SharePoint column formatting lets you control how a field appears in a list or library. You create JSON that tells SharePoint what to display and how to style it. 

In the SharePoint lists we work with, status fields are one of the clearest places where column formatting helps. Values such as Not Started, In Progress, and Completed can be difficult to distinguish when they appear as regular text. JSON formatting can give these values distinct visual treatment, making the status of each item easier to recognize while scanning the list. 

The important point is that formatting changes the presentation, not the underlying data. If a column contains “Completed,” JSON can change how that value looks, but the stored value remains “Completed.” 

This makes column formatting useful when the list already works as intended but its information needs to be easier to scan. 
How SharePoint column formatting JSON works, showing four steps: column value, JSON condition, visual formatting, and an easier-to-scan SharePoint list.

How Do I Use JSON Formatting to Format Columns in SharePoint?

You can add JSON directly from the formatting options of a SharePoint list or library. 

Open the list and select the column you want to customize. Choose Column settings > Format this column. When the formatting pane opens, switch to Advanced mode to enter or edit JSON. 

A basic format looks like this: 

JSON Example

{
  "elmType": "div",
  "txtContent": "@currentField"
}

This JSON tells SharePoint to display the current column value inside a div element. It does not add conditional styling yet, which makes it a useful starting point. 

After adding the JSON, preview the result and check it against different values in the column. Once the formatting behaves as expected, save it. 

Understanding SharePoint Column Formatting JSON

You do not need to learn every part of JSON before you start formatting SharePoint columns. However, a few properties and references appear regularly. 

elmType tells SharePoint which element to render. For example, div works as a container for the column content. 

txtContent defines the text that appears inside that element. When you use @currentField, SharePoint displays the value of the column you are formatting. 

style controls visual properties such as background color, text color, padding, and font weight. 

attributes lets you define additional properties when an element requires them. 

You can also use references such as [$Status] to read another field from the same list item. This becomes useful when the appearance of one column depends on information stored in another. 

Once you understand these elements, you can adjust existing JSON examples instead of writing every format from scratch. 

SharePoint Column Formatting JSON Examples

Once you understand the basic structure, you can add conditions that make list information easier to interpret. The following SharePoint column formatting JSON examples cover two common situations: identifying a specific status and drawing attention to dates that have passed. 

Change the Color Based on a Column Value

We often see status columns where values such as “Completed” need to stand out from items that still require action. Giving that value a different background makes completed items easier to identify when users scan the list. 

JSON Example

{
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "background-color": "=if(@currentField == 'Completed', '#dff6dd', '')",
    "padding": "4px 8px"
  }
}

Here, @currentField represents the value in the Status column. The if expression checks whether that value equals “Completed.” If it does, SharePoint applies the specified background color. Otherwise, it leaves the background unchanged. 

You can use the same approach for priority levels, approval results, project stages, and other fields where the value determines how the column should appear. 

Highlight Overdue Dates

Due dates often need more attention because users need to see quickly which items require action. JSON lets you compare a date field with the current date and time. 

JSON Example

{
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "color": "=if(@currentField <= @now, '#a4262c', '')",
    "font-weight": "=if(@currentField <= @now, '600', 'normal')"
  }
}

@now represents the current date and time. When the field value is earlier than or equal to @now, SharePoint changes its text color and font weight. This makes dates that need attention easier to identify while scanning the list. 

However, the condition should match the way your list works. If completed tasks remain visible after their due dates, checking the date alone could make finished work appear overdue. In that case, you can also reference the Status column in the condition. 

How to Reference Other Columns in JSON Formatting

SharePoint list column formatting JSON becomes more useful when the formatting can respond to other fields in the same list item. 

In more detailed list formatting, we often need one column to respond to the value stored in another. A Task Name column, for instance, can change its text color when the Status field contains “Completed.” To do this, you can reference the Status field directly: 

JSON Expression

"color": "=if([$Status] == 'Completed', '#107c10', '')"

[$Status] tells SharePoint to read the Status field from the current list item rather than the column you are currently formatting. 

Pay attention to field names when using these references. The internal field name in SharePoint may differ from the name displayed to users. For example, spaces in a field’s internal name can appear as _x0020_. A field displayed as “Due Date” could therefore have an internal name such as Due_x0020_Date. 

If your JSON structure looks correct but a cross-column condition does not work, check the internal field name before changing the condition itself. 

Common Problems with SharePoint JSON Column Formatting

JSON follows a strict structure. A missing quotation mark, comma, bracket, or brace can prevent the format from working correctly. For that reason, make one change at a time and test the result before adding another condition. 

Incorrect field references can also cause problems. This often happens when the visible column name differs from its internal SharePoint name. If a condition involving another field does not work, verify the field reference first. 

Empty values need attention as well. For example, a date condition should account for blank fields instead of assuming that every item contains a valid date. The same principle applies to number, choice, and text fields. 

Finally, test the formatting with different types of list items. Do not check only the value you used while writing the JSON. Test completed and incomplete statuses, past and future dates, and blank fields where relevant. This helps you catch conditions that work in one case but produce unexpected results elsewhere. 

How to Keep SharePoint Column Formatting Easy to Maintain

Good column formatting should make information easier to understand. Adding too many colors, conditions, or visual effects can have the opposite effect. 

Start with fields where visual differences have a clear meaning. Status, priority, deadlines, and approval results are strong candidates because users often need to recognize these values quickly. 

Keep the JSON conditions focused as well. Several nested conditions may work, but they become harder to troubleshoot and update. Start with the simplest rule that solves the problem. Then add another condition only when the list requires it. 

You should also treat copied JSON as a starting point rather than a finished solution. A SharePoint column formatting JSON example may use different field names, choice values, or column types from your list. Update those references and conditions before applying the format to a live list. 

Improve Your SharePoint Experience with Code Creators

SharePoint lists should make information easier to manage, not leave users spending extra time finding the fields and items that need attention. JSON column formatting can improve that experience, but it works best when it fits the list structure, business process, and way users interact with the data. 

At Code Creators, our SharePoint development services help businesses improve SharePoint environments around these practical needs. From refining lists and their structure to creating custom solutions for more complex requirements, the focus stays on making SharePoint easier to use and manage as business needs change. 

Ready to improve how your teams work with SharePoint? Get in touch with Code Creators to discuss a SharePoint solution built around your business requirements. 

Conclusion

SharePoint column formatting JSON works best when you use it to solve a specific readability problem. @currentField lets you work with the column being formatted, while references such as [$Status] let you use another field in the same item. Expressions such as if() and @now then allow the appearance of a column to respond to its actual data. 

You do not need complex JSON to make a SharePoint list easier to use. A simple condition that distinguishes a completed status or highlights a past due date can make important information easier to find without changing the underlying values. 

Start with one column and one clear condition. Test it against normal values, blank fields, and less common cases before expanding the formatting. This keeps your JSON easier to troubleshoot and maintain while giving users a clearer view of the information that requires their attention. 

If your lists need more than individual formatting fixes, explore how Code Creators can help you turn SharePoint into a clearer and more efficient workspace for your team.

FAQs

Select the column you want to format, choose Column settings > Format this column, and apply formatting based on the column’s values. For more control, open Advanced mode and use JSON expressions such as if() with @currentField. This allows you to change colors, styles, or other visual elements when specific conditions are met without changing the stored data. 

Open your SharePoint list or library, select the column header, and go to Column settings > Format this column > Advanced mode. Enter the JSON formatting and save your changes. You can use properties such as elmType, txtContent, and style to control how the column value appears.  

SharePoint conditional formatting lets you change how a field appears according to its value. For example, JSON can apply a different style when a status reaches a particular value or when a date passes the current date. You can use expressions such as if(), @currentField, and @now to define these conditions.  

Select the column heading and choose Column settings > Format this column. You can use the available formatting options or select Advanced mode when you need JSON-based customization. Column formatting changes how information is displayed in the list while leaving the underlying data unchanged. 

Use Advanced mode in the Format column pane to add JSON that defines how SharePoint should display the column. @currentField refers to the value of the column being formatted, while references such as [$Status] can use values from other fields in the same row. This makes it possible to create formatting that responds to the actual list data. Microsoft notes that referenced fields need to be included in the same view. 

Author

  • George Ali - CTO at Code Creators
    CTO at Code Creators

    As the CTO at Code Creators, I drive technological innovation, spearhead strategic planning, and lead teams to create cutting-edge, customized solutions that empower clients and elevate business performance.

    View all posts