SOLVED

Formatting View in List based on criteria

Copper Contributor

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', '')"
}

2 Replies
best response confirmed by DekkerNick1 (Copper Contributor)
Solution

@DekkerNick1 can you replace the utcNow by the '@now' special string value?

https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-syntax-referen...

 

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', '')"
}

 

 

oplostijden.png

Absolute legend! This works perfect. 🙂
1 best response

Accepted Solutions
best response confirmed by DekkerNick1 (Copper Contributor)
Solution

@DekkerNick1 can you replace the utcNow by the '@now' special string value?

https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-syntax-referen...

 

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', '')"
}

 

 

oplostijden.png

View solution in original post