Forum Discussion
carlblunck
Aug 18, 2022Copper Contributor
Conditional formatting help
Hi community, Just need some help with some JSON conditional formatting code. Snip of my list, note the current result values are blank because of the JSON code issue. Current JSON script...
- Aug 19, 2022
carlblunck you've missed out the second =
It should be =='Under' etc
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "color": "=if((@currentField > [$Benchmark] && [$Goal]) == 'Under', 'red', if((@currentField < [$Benchmark] && [$Goal]) == 'Over', 'red', 'green')", "font-weight": "=if((@currentField > [$Benchmark] && [$Goal]) == 'Under', 'bold', if((@currentField < [$Benchmark] && [$Goal]) == 'Over', 'bold', 'normal')" } }Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
RobElliott
Aug 19, 2022Silver Contributor
ganeshsanap I'd already given the JSON code that works fine, even with the extra brackets. Be careful not to step on someone else's solution.
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
ganeshsanap
Aug 19, 2022MVP
RobElliott Thank you for your response. Did you actually tried using the JSON you provided?
Try using the JSON you provided & let us know the results. Thank you.