JSON formatting breaks grid view

Brass Contributor

Hi!
I have a list with all my users data. 
When I try to edit some items in Grid view, I notice that it is broken. 
One of my user doesn't have Work phone number in the field Work Mobile Number.

Pavel2235_0-1700572243243.png

 


This field has a Person or Group type and show field as Work phone.

Pavel2235_1-1700572243243.png

 


Additionally, I have added JSON formatting to this column.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "box-sizing": "border-box",
    "padding": "0 2px",
    "overflow": "hidden",
    "text-overflow": "ellipsis"
  },
  "attributes": {
    "class": "sp-css-backgroundColor-BgMintGreen sp-css-borderColor-MintGreenFont sp-css-color-MintGreenFont sp-field-bold"
  },
  "txtContent": "[$Work_x0020_Mobile_x0020_Number.title]",
  "defaultHoverField": "[$Work_x0020_Mobile_x0020_Number]"
}

I tried to remove JSON from this column and it worked.
It’s strange why if there is no data in this field, JSON breaks it.
And I don't know how to fix it without removing JSON. 

0 Replies