Skip to main content
2 of 2
added 596 characters in body
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63

To do the comparison against the current date, you need to use the @now. Also, you need to calculate a date 5 days back from today. So, you need to subtract 5 days worth of milliseconds, (5 * 24 * 60 * 60 * 1000 = 432000000).

So, try using below JSON code:

{
    "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
    "additionalRowClass": "=if([$ApprovalStatus] == 'Pending' && [$RequestDate] < @now-432000000, 'sp-field-severity--severeWarning', '')"
}

References:

  1. Use view formatting to customize SharePoint
  2. SharePoint Online Custom Format View issue with @now and UK Date format
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63