SharePoint 2019 Column Formatting On Premise doesn't work when you add it on a Page with List Web P

Frequent Visitor

SharePoint 2019 Column Formatting On Premise doesn't work when you add it on

a Page with List Web Part

 How to test 

Try this on SharePoint online and On premise

Do column formatting with this json

Then  add a page  with communication template 

Add list select the view 

check the conditional formatting is gone  on On Prem 

 check the conditional formatting is working on On Office 365

Json used  is 

{
 "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "debugMode": true,
    "elmType": "div",
    "txtContent": "@currentField",
    "style": {
                "background-color": {
                                        "operator": "?",
                                        "operands": [
                                        {
                                            "operator": "==",
                                            "operands": [
                                                "[$ColorCoded]",
                                                "Red"
                                            ]
                                        },
                                        "red",
                                        {
                                            "operator": "?",
                                            "operands": [
                                            {
                                                "operator": "==",
                                                "operands": [
                                                    "[$ColorCoded]",
                                                    "Blue"
                                                ]
                                            },
                                            "aqua",
                                            {
                                            "operator": "?",
                                            "operands": [
                                            {
                                                "operator": "==",
                                                "operands": [
                                                    "[$ColorCoded]",
                                                    "Green"
                                                ]
                                            },
                                            "Green",
                                            "silver"
                                        ]
                                    }
                                        ]
                                    }   

                                ]
                            },
                "color": "black",
                "padding-left": "10px"
    }

 }

tempsnip.png

2 Replies
I think this could be related to the fact that the list WebPart in SP 2019 is not the most updated one we have in SPO...so if the version in SP 2019 does not support column formatting, that's why you are not seeing your customizations in that WebPart

There is some difference in JSON format in On-prem and Sharepoint online@jinthakur

Excel-style Syntax does not work in the On-prem version.

Inbox me I can rectify this JSON.