Question

I want to insert some JSON into my SharePoint list.

Basically I have a Modified column that shows me when a value in a row has last been modified. I would like to have a row turn red if it has been Modified within the last day, and orange if it was been within the last week.

I'm new to JSON and was looking for some help. thanks!

Was it helpful?

Solution

Use below JSON in Format current view:

{
  "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "additionalRowClass": "=if([$Modified] < @now && [$Modified] >= @now - 86400000, 'sp-field-severity--blocked', if([$Modified] < @now && [$Modified] >= @now - 604800000, 'sp-field-severity--warning' , ''))"
}

For more information on how to use JSON view formatting follow this:

  1. Formatting list row based on status column Office365
  2. Use view formatting to customize SharePoint

You can use the following predefined classes for several common scenarios:

Predefined classes

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top