Using JSON to change the color of a row based on the date it was Modified
Domanda
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!
Soluzione
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:
You can use the following predefined classes for several common scenarios:
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange