I am working on a list in Sharepoint Online where I have used JSON to create conditional formatting for different columns. When I am viewing the list as "All Items" the formatting works as expected, however if I switch to a view where the column the formatting depends on is hidden and then refresh the view, each item is replaced with the following:
"Failure: Hidden_x0020_Column was not found in the data object."
This also appears for any new item added in the view with hidden columns, and is only resolved by switching to the view with All Items - where all entries appear properly formatted - and then switching back to the view with hidden columns. Is there a way to resolve this, or is JSON only able to account for data that appears in the current view? My code is as follows:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"debugMode": true,
"txtContent": "@currentField",
"style": {
"background-color": "=if([$Hidden_x0020_Column_x0020_One] == 'Yes', '#ffff00',''",
"color": "=if([$Hidden_x0020_Column_x0020_Two] == 'Yes', '#9400d3', if([$Hidden_x0020_Column_x0020_Three] == 'No', '#32cd32',''"
}
}
Unfortunately, I do not have access to Sharepoint Designer or the Content Editor on Sharepoint, so I am trying to find a way to work around this using JSON. If anyone has an idea or solution, I would be grateful to hear it, thank you in advance.