Formatting list views

Applies to: SharePoint Online.

About formatting views

Enrich the display of views in SharePoint lists with formatting. The view-formatting text outlines the elements that are presented and their display style. The data in the list doesn’t change.

View Options button

Anyone who can create and manage views in a list can access view formatting from the View options menu.

View formatting example

A default view, without formatting, has an equal style for every row.

A list without formatting applied

With view formatting, you can highlight rows that qualify for a condition.

List view with formatting showing yellow, red and green bands

This example considers different styles for rows according to status. Paste the JSON below, containing the brackets {}, in the textbox in the Format view panel. Insert a column called ‘Status’ and type ‘Done’ in one row to view the style applied. {   "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",   "additionalRowClass": "=if([$Status] == 'Done', 'sp-field-severity--good', if([$Status] == 'In progress', 'sp-field-severity--low' ,if([$Status] == 'In review','sp-field-severity--warning', if([$Status] == 'Blocked','sp-field-severity--blocked', ''))))" }

How to

View formatting is employed utilising a text format called JSON. However, being an expert on JSON is not required to format views. JSON is a text-based data definition language that classifies JSON objects as text pairs. For example, “name”: John, or “state”: WA are objects.

The simplest way to apply view formatting is to begin from an example and alter it to be pertinent to your particular field. There is an example above you can copy, paste, and edit for your circumstances.

The full reference on list view formatting JSON has more examples you can copy, paste, and edit.

This information was compiled using information courtesy of © Microsoft 2020. All rights reserved.

Leave a Reply

%d bloggers like this: