1

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!

1 Answer 1

3

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

1
  • Awesome, thanks!
    – mmmmm
    Commented Feb 10, 2021 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.