Sharepoint Column formatting breaks library

Copper Contributor

Hi!

 

I´ve been trying to use column formatting for a while now, but whenever I use it my library items don´t load

 

When I use Columns formatting my library looks like this

image.png

When it should look like this

 

image.png

 

Anyone has any idea why it happens? I´ll leave the JSON if its of any help

 

{
  "$schema": "<a href="<a href="https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json" target="_blank">https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json</a>" target="_blank"><a href="https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json</a" target="_blank">https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json</a</a>>",
  "elmType": "div",
  "attributes": {
    "class": "=if(@currentField == 'Pass', 'sp-field-severity--good',  if(@currentField == 'Error: Resultado no seleccionado', 'sp-field-severity--severeWarning', 'sp-field-severity--blocked')) + ' ms-fontColor-neutralSecondary'"
  },
  "children": [
    {
      "elmType": "span",
      "style": {
        "display": "inline-block",
        "padding": "0 4px"
      },
      "attributes": {
        "iconName": "=if(@currentField == 'Pass', 'CheckMark',  if(@currentField == 'Error: Resultado no seleccionado', 'Warning', 'ErrorBadge'))"
      }
    },
    {
      "elmType": "span",
      "txtContent": "@currentField"
    }
  ]
}

 

 

Thanks for your help

0 Replies