SOLVED

SharePoint list formatting issue -multiline text column doesn't show values after formated with JSON

Brass Contributor

Hi,

I am struggling with the simple formatting of the multiline text field (not a rich text field). I want to display the pencil which when you click, opens the item in the edit mode. When I apply the JSON format below values in my column disappear but the pencil is visible and actionable. Can you tell me what am I doing wrong?

 

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "div",
      "txtContent": "@currentField",
      "style": {
        "white-space": "nowrap",
        "overflow": "hidden",
        "text-overflow": "ellipsis"
      },
      "attributes": {
        "iconName": "Edit",
        "class": "sp-field-quickActions"
      },
      "customRowAction": {
        "action": "editProps"
      }
    }
  ]
}

 

 

 

 

Redirect me with my question if this is not the right forum.

 

Here it is before applying the format:

 

Michal_Z_0-1681822573894.png

And here is after applying the format;

Michal_Z_1-1681822623389.png

 

 

 

4 Replies
best response confirmed by Michal_Z (Brass Contributor)
Solution

@Michal_Z Can you please check and confirm if there is any data for starting items/rows shown in your screenshot?

 

I just tried using same JSON you provided and it is working fine for me: 

ganeshsanap_0-1681825615248.pngAlso, for last item/row in your screenshot I can see some HTML code. This HTML comes when you are using rich text (or if you are manually entering HTML in plain text) column. Can you check one more time if the column is plain text or rich text column?

 

Related readHow to find the Internal name of columns in SharePoint Online? 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

Hi @ganeshsanap

You were right. This field was marked as rich text. I was sure that it is not but I was wrong. 

Now, when I correct the filed type, all looks OK. 

 

Do you know by the way how to limit the height of the row on thee format view?

I tried the following but without any impact on the height of the rows. 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "elmType": "div",
  "style": {
     "min-height":"1em",
     "height": "1em"
  } 
}

@Michal_Z Height or row depends on the largest height of content from all the columns in the list view. 

 

If you want to reduce the height of row, try to limit the height of columns / truncate text in columns to fixed number of characters using column formatting. Height of row will be automatically adjusted accordingly.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

1 best response

Accepted Solutions
best response confirmed by Michal_Z (Brass Contributor)
Solution

@Michal_Z Can you please check and confirm if there is any data for starting items/rows shown in your screenshot?

 

I just tried using same JSON you provided and it is working fine for me: 

ganeshsanap_0-1681825615248.pngAlso, for last item/row in your screenshot I can see some HTML code. This HTML comes when you are using rich text (or if you are manually entering HTML in plain text) column. Can you check one more time if the column is plain text or rich text column?

 

Related readHow to find the Internal name of columns in SharePoint Online? 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

View solution in original post