Forum Discussion
Formatting View in List based on criteria
Hi all,
I have a SharePoint list in which I would like to create a formatting view on row-level. I want to achieve that the rows will be visualized red when the Urgency is set to 'Oplossen binnen <6 maanden' (English (Solve in 6 months), the status is unequal to 'Gereed' (English: Done) and the item has been there for over 6 month checking to the date it is created.
I used following syntax but unfortunately nothing happens. Can someone help me with this?
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"additionalRowClass": "=if([$Urgentie] == 'Oplossen binnen <6 maanden' && [$Status] != 'Gereed' && (Number(utcNow()) - Number([$Created])) > 15778800000, 'ms-bgColor-redDark', '')"
}
DekkerNick1 can you replace the utcNow by the '@now' special string value?
Try something like below
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "additionalRowClass": "=if([$Urgentie] == 'Oplossen binnen <6 maanden' && [$Status] != 'Gereed' && (Number(@now) - Number([$Created])) > 15778800000, 'ms-bgColor-redDark', '')" }
2 Replies
- ExpiscornovusIron Contributor
DekkerNick1 can you replace the utcNow by the '@now' special string value?
Try something like below
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "additionalRowClass": "=if([$Urgentie] == 'Oplossen binnen <6 maanden' && [$Status] != 'Gereed' && (Number(@now) - Number([$Created])) > 15778800000, 'ms-bgColor-redDark', '')" }
- DekkerNick1Copper ContributorAbsolute legend! This works perfect. 🙂