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. ...
xoxidein
May 27, 2022Iron Contributor
I'm clearly missing something. I copied your code over mine, and it changes it to teal, but I get the error:
Error saving column format: {"d": {"CustomFormatter": "{\"$schema\":\"https:\u002F\u002Fdeveloper.microsoft.com\u002Fjson-schemas\u002Fsp\u002Fv2\u002Fcolumn-formatting.schema.json\",\"elmType\":\"div\",\"txtContent\":\"@currentField\",\"style\":{\"color\":\"white\",\"background-color\":\"=if(toLocaleDateString(@currentField+1296000000) <= toLocaleDateString(@now), 'green', if(toLocaleDateString(@currentField+604800000) <= toLocaleDateString(@now) , 'orange', 'red'))\"}}", "Id": ""}}
Could it be because this is a calculated column? The value (which is a date) is based on another date field plus 21 days.
Error saving column format: {"d": {"CustomFormatter": "{\"$schema\":\"https:\u002F\u002Fdeveloper.microsoft.com\u002Fjson-schemas\u002Fsp\u002Fv2\u002Fcolumn-formatting.schema.json\",\"elmType\":\"div\",\"txtContent\":\"@currentField\",\"style\":{\"color\":\"white\",\"background-color\":\"=if(toLocaleDateString(@currentField+1296000000) <= toLocaleDateString(@now), 'green', if(toLocaleDateString(@currentField+604800000) <= toLocaleDateString(@now) , 'orange', 'red'))\"}}", "Id": ""}}
Could it be because this is a calculated column? The value (which is a date) is based on another date field plus 21 days.
May 29, 2022
RobElliott's solution worked for me. To be sure there isn't something else going on, change the view formatter to design mode and select alternating rows. Save it and make sure it works.
If that works, either edit from there, or compare with what you have to see if you can figure out what is tripping you up. Usually, the editor catches if something is wrong, but it's not perfect.
If it doesn't work, try it on a different list and see if you can duplicate the issue.
If that works, either edit from there, or compare with what you have to see if you can figure out what is tripping you up. Usually, the editor catches if something is wrong, but it's not perfect.
If it doesn't work, try it on a different list and see if you can duplicate the issue.