SharePoint List JSON Formatting

SharePoint lists are a powerful feature that allows you to store and manage data within your SharePoint environment. While SharePoint provides numerous ways to view and interact with this data, one of the most flexible and customizable methods is through JSON formatting. JSON (JavaScript Object Notation) formatting enables you to transform the appearance of your SharePoint lists, enhancing both the user experience and the efficiency of data management.

SharePoint List View Customization Using JSON Formatting
SharePoint List View Customization Using JSON Formatting

In this article, we'll delve into the world of SharePoint list JSON formatting. We'll explore what it is, its benefits, and provide practical examples to help you get started. By the end, you'll have a solid understanding of how to leverage JSON formatting to create visually appealing and functional SharePoint lists.

SharePoint List Form Formatting with JSON & flow approvals (2)
SharePoint List Form Formatting with JSON & flow approvals (2)

Understanding SharePoint List JSON Formatting

JSON formatting is a method in SharePoint that allows you to customize the way your list data is displayed. It uses JSON, a lightweight data interchange format, to define the visual properties and behavior of your list items. With JSON formatting, you can change the color, font, size, and alignment of text, add icons, and even modify the layout of your list items.

SharePoint List Title Column [Remove or Hide Title Column With Examples]
SharePoint List Title Column [Remove or Hide Title Column With Examples]

JSON formatting is particularly useful when you want to highlight specific data, draw attention to important information, or create a more engaging user interface. It's a powerful tool that can help you make your SharePoint lists more intuitive and user-friendly.

Benefits of SharePoint List JSON Formatting

Customize Modern SharePoint List Forms Tutorial | JSON Formatting, Validations
Customize Modern SharePoint List Forms Tutorial | JSON Formatting, Validations

JSON formatting offers several benefits that can help you get more out of your SharePoint lists. Here are a few key advantages:

  • Customization: JSON formatting gives you a high degree of control over the appearance of your list data. You can tailor the look and feel of your lists to match your organization's branding or to better suit the needs of your users.
  • Improved User Experience: By making your lists more visually appealing and intuitive, JSON formatting can help your users engage with your data more effectively. This can lead to increased productivity and better data management.
  • Efficiency: Once you've created a JSON format, you can apply it to multiple lists, saving you time and effort. This makes it a highly efficient way to manage the appearance of your lists at scale.

Getting Started with SharePoint List JSON Formatting

Display SharePoint List Items in a SPFX Web Part [Tabular Format]
Display SharePoint List Items in a SPFX Web Part [Tabular Format]

To get started with SharePoint list JSON formatting, you'll need to have a basic understanding of JSON syntax. JSON is a simple data format that uses key-value pairs to store data. Here's a simple example of what JSON looks like:

&{
  "name": "John Doe",
  "age": 30,
  "isEmployee": true
}

In the context of SharePoint list JSON formatting, the keys are the field names from your list, and the values are the visual properties or behaviors you want to apply to those fields.

To apply JSON formatting to a SharePoint list, you'll need to use the "Format as" option in the list's settings. This will open a pane where you can enter your JSON code. Once you've entered your code, click "OK" to apply the formatting to your list.

Why You Should Never Embed Document Libraries and Lists into SharePoint Pages
Why You Should Never Embed Document Libraries and Lists into SharePoint Pages

JSON Formatting Examples

Now that we've covered the basics of SharePoint list JSON formatting, let's look at some practical examples. These examples will demonstrate how to use JSON formatting to change the color of text, add icons, and modify the layout of your list items.

SharePoint List Formatting for Grouped Views
SharePoint List Formatting for Grouped Views
Use column formatting to customize SharePoint | Microsoft Docs
Use column formatting to customize SharePoint | Microsoft Docs
Site Collections, Sites, Pages, Document Libraries, and Folders - putting it all together | SharePoint Maven
Site Collections, Sites, Pages, Document Libraries, and Folders - putting it all together | SharePoint Maven
InfoPath Vs SharePoint Designer
InfoPath Vs SharePoint Designer
Add Conditional Formatting to a SharePoint Online List
Add Conditional Formatting to a SharePoint Online List
Some Top Reasons to Use SharePoint
Some Top Reasons to Use SharePoint
How to implement Document Management System in SharePoint using Content Types | SharePoint Maven
How to implement Document Management System in SharePoint using Content Types | SharePoint Maven
the steps to managing permisions info sheet is shown in blue and pink colors
the steps to managing permisions info sheet is shown in blue and pink colors
How to Personalize SharePoint for Users
How to Personalize SharePoint for Users
How to track documents in SharePoint using Document ID feature | SharePoint Maven
How to track documents in SharePoint using Document ID feature | SharePoint Maven
a poster with different types of text and pictures on the front page, including an image of
a poster with different types of text and pictures on the front page, including an image of
Learn How To Implement Sharepoint List Validation
Learn How To Implement Sharepoint List Validation
SharePoint Content Types - BoostSolutions
SharePoint Content Types - BoostSolutions
The knowledge base Sharepoint intranet homepage
The knowledge base Sharepoint intranet homepage
Step-by-Step Guide: Syncing SharePoint List to Power Pages Table
Step-by-Step Guide: Syncing SharePoint List to Power Pages Table
How to Get Started with SharePoint Look Book
How to Get Started with SharePoint Look Book
How To Create A Page In SharePoint: A Step-By-Step Guide
How To Create A Page In SharePoint: A Step-By-Step Guide
SharePoint for Beginners: A complete guide to getting started
SharePoint for Beginners: A complete guide to getting started
📊 How to create Charts in Microsoft SharePoint Lists
📊 How to create Charts in Microsoft SharePoint Lists
Top 5 Limitations of SharePoint Online
Top 5 Limitations of SharePoint Online

Changing the Color of Text

One of the simplest ways to use JSON formatting is to change the color of text in your list. To do this, you'll use the "style" property in your JSON code. Here's an example that changes the color of the "Title" field to red:

&{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "additionalRowClass": "sp-field-severity--high",
  "properties": {
    "Title": {
      "style": {
        "color": "red"
      }
    }
  }
}

In this example, the "style" property is used to set the color of the "Title" field to red. The "additionalRowClass" property is used to add a class to the row that contains the "Title" field. This can be useful for applying additional styles to the row, such as changing its background color.

Adding Icons

Another common use of JSON formatting is to add icons to your list items. Icons can be used to draw attention to important data or to provide visual cues to your users. Here's an example that adds a checkmark icon to the "Completed" field when the value is "Yes":

&{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "properties": {
    "Completed": {
      "operator": "!==",
      "operands": [
        "Yes"
      ],
      "style": {
        "iconName": "CheckMark",
        "iconSize": 16
      }
    }
  }
}

In this example, the "operator" and "operands" properties are used to check if the value of the "Completed" field is "Yes". If it is, the "style" property is used to add a checkmark icon to the field. The "iconSize" property is used to set the size of the icon.

Advanced JSON Formatting Techniques

While the examples above demonstrate some of the most common uses of JSON formatting, there are many more advanced techniques you can use to customize your SharePoint lists. For example, you can use JSON formatting to:

Modify the Layout of Your List Items

JSON formatting allows you to modify the layout of your list items by adding or removing columns, changing the order of columns, or even creating custom layouts. Here's an example that removes the "Modified" column and moves the "Title" column to the right:

&{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "hideColumns": [
    "Modified"
  ],
  "columnOrder": [
    "Title",
    "Created",
    "Completed"
  ]
}

In this example, the "hideColumns" property is used to remove the "Modified" column, and the "columnOrder" property is used to change the order of the remaining columns.

Create Conditional Formatting

JSON formatting also allows you to create conditional formatting rules that apply different styles based on the value of a field. Here's an example that changes the background color of a row based on the value of the "Priority" field:

&{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "conditionalFormatting": {
    "rules": [
      {
        "operator": "==",
        "operands": [
          "High"
        ],
        "style": {
          "backgroundColor": "#FF0000"
        }
      },
      {
        "operator": "==",
        "operands": [
          "Medium"
        ],
        "style": {
          "backgroundColor": "#FFFF00"
        }
      },
      {
        "operator": "==",
        "operands": [
          "Low"
        ],
        "style": {
          "backgroundColor": "#00FF00"
        }
      }
    ]
  }
}

In this example, the "conditionalFormatting" property is used to define a set of rules that apply different background colors based on the value of the "Priority" field.

As you can see, SharePoint list JSON formatting is a powerful tool that offers a wide range of possibilities for customizing the appearance of your lists. Whether you're looking to add a simple touch of color or create a complex, interactive user interface, JSON formatting can help you achieve your goals.

In the world of SharePoint, the possibilities for customization are endless. JSON formatting is just one of many tools at your disposal for making your lists more engaging, intuitive, and efficient. So why not give it a try? With a little creativity and some experimentation, you can unlock the full potential of your SharePoint lists and take your data management to the next level.