SharePoint Online JSON Formatting Working on Edit Form but not in List view

26 views Asked by At

I have a SharePoint Online list that was working fine the other day with some conditional JSON associated. It changes the background color based on another field. I can see that background color is working correctly when I double click on an individual item, but when I'm looking at all the items on the list view it's not working.

Here is my code:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "color": "=if( [$Step5Complete] == true, '#000000','#FFFFFF')",
    "font-weight": "bold",
    "background-color": "=if([$Step5Complete] == true,'', if    (@currentField >= @now + 1209600000, 'green', if(@currentField < @now, 'red','yellow')))"
  }
}

When Step5Complete is true there should be no background color, but the background colors are still in place on the main view. I tried having another user check in case it was just a cache issue, but he's seeing the same thing where there is color on the list view, but no color (which is correct) on the Item View.

1

There are 1 answers

0
user23616112 On

I found out that the issue was the columns I was referencing to change the color needed to be in the view and weren't. I didn't realize that previously.