Sharepoint Column formatting breaks library

%3CLINGO-SUB%20id%3D%22lingo-sub-882673%22%20slang%3D%22en-US%22%3ESharepoint%20Column%20formatting%20breaks%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-882673%22%20slang%3D%22en-US%22%3E%3CP%3EHi!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%C2%B4ve%20been%20trying%20to%20use%20column%20formatting%20for%20a%20while%20now%2C%20but%20whenever%20I%20use%20it%20my%20library%20items%20don%C2%B4t%20load%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20use%20Columns%20formatting%20my%20library%20looks%20like%20this%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134128i3AD01216E4966D93%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EWhen%20it%20should%20look%20like%20this%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20961px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134129i78D22E13160349A7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20has%20any%20idea%20why%20it%20happens%3F%20I%C2%B4ll%20leave%20the%20JSON%20if%20its%20of%20any%20help%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%7B%0A%20%20%22%24schema%22%3A%20%22%3CA%20href%3D%22%26lt%3Ba%20href%3D%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%3C%2FA%3E%22%20target%3D%22_blank%22%26gt%3B%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%26lt%3B%2Fa%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%3C%2FA%3E%26gt%3B%22%2C%0A%20%20%22elmType%22%3A%20%22div%22%2C%0A%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%22class%22%3A%20%22%3Dif(%40currentField%20%3D%3D%20'Pass'%2C%20'sp-field-severity--good'%2C%20%20if(%40currentField%20%3D%3D%20'Error%3A%20Resultado%20no%20seleccionado'%2C%20'sp-field-severity--severeWarning'%2C%20'sp-field-severity--blocked'))%20%2B%20'%20ms-fontColor-neutralSecondary'%22%0A%20%20%7D%2C%0A%20%20%22children%22%3A%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22elmType%22%3A%20%22span%22%2C%0A%20%20%20%20%20%20%22style%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22display%22%3A%20%22inline-block%22%2C%0A%20%20%20%20%20%20%20%20%22padding%22%3A%20%220%204px%22%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22iconName%22%3A%20%22%3Dif(%40currentField%20%3D%3D%20'Pass'%2C%20'CheckMark'%2C%20%20if(%40currentField%20%3D%3D%20'Error%3A%20Resultado%20no%20seleccionado'%2C%20'Warning'%2C%20'ErrorBadge'))%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22elmType%22%3A%20%22span%22%2C%0A%20%20%20%20%20%20%22txtContent%22%3A%20%22%40currentField%22%0A%20%20%20%20%7D%0A%20%20%5D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-882673%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Visitor

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