SharePoint & Microsoft 365

SharePoint View Formatting JSON: Conditions, Rows and Safe Testing

Use SharePoint view formatting JSON to add conditional row styling and custom layouts while preserving data, permissions and accessible fallbacks.

Collab365 Team · 9 April 2019 · Updated 24 August 2026 · 2 min read

SharePoint view formatting changes how list and library items are displayed. It does not change stored data, grant permissions or create workflow logic.

Use it when a visual cue helps a reader spot status, ownership or urgency. Keep the underlying values readable because exports, APIs and assistive technology should not depend on colour alone.

Choose the right formatting surface

In Format current view, SharePoint uses different properties for different layouts:

  • List and Compact List can use additionalRowClass or rowFormatter.
  • Gallery uses formatter.
  • Board also uses formatter.

Microsoft documents these distinctions in Use view formatting to customise SharePoint.

Use additionalRowClass when the normal row layout is useful and you only need a conditional style. A complete rowFormatter replaces the row presentation, so it needs more testing.

Example: highlight overdue work

This example assumes a Date and time column with the internal name DueDate, plus a Status choice column named Status.

Open the view menu, select Format current view, choose Advanced mode, save the existing JSON somewhere recoverable, then paste:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "additionalRowClass": "=if([$DueDate] < @now && [$Status] != 'Completed', 'sp-field-severity--blocked', '')"
}

This applies a Microsoft-provided severity class when the due date has passed and the item is not completed. The row still contains its original fields.

Internal names matter. A column displayed as “Due date” may have an encoded internal name. Inspect the column URL or use the editor suggestions to confirm it.

Build a custom row carefully

A rowFormatter can control elements, text and styles across the row. Before replacing the row:

  1. list the fields and actions users need
  2. keep meaningful text visible
  3. use theme classes where possible
  4. add accessible labels to icon-only actions
  5. test empty, long and unexpected values

Microsoft's formatting syntax reference documents expressions, operators, attributes and supported styles.

Formatting can render links or supported actions. It does not bypass SharePoint permissions. If a button changes business state, use a supported action or flow with permissions, validation and failure handling.

Test and recover safely

Test with a copy of the view and representative data: empty fields, long titles, every choice, dates before and after today, different permissions, keyboard navigation and narrow layouts.

Keep the previous JSON. If the view becomes unusable, remove or restore its formatting. The list data remains unchanged, but the presentation may hide information until fixed.

This example proves the supported expression pattern, not compatibility with your internal column names or every custom view. Validate it before applying it to a shared production view.

For help making SharePoint lists clearer without disguising data and permissions, join the SharePoint & Teams Admins Space.

Sources