Forum Discussion
xoxidein
May 20, 2022Iron Contributor
JSON Error When Making No Changes
Trying to learn JSON so I can do some fun stuff with values coloring of lists. I currently have a calculated column with: =IF([Starting Date]="","",[Starting Date]+21) and that works fine. ...
RobElliott
May 21, 2022Silver Contributor
xoxidein "For example, leaving it like this:..." you can't do that because the JSON is not doing anything, all you've got is the schema so it will inevitably give you an error. What you need is JSON like this which is formatting the Workdays+21 column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"padding-left": "14px",
"background-color": "=if(@currentField <= @now, '#c00000','teal')",
"color": "white"
}
}
That gives the following result:
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)