Multiline Enhanced Rich Text and Column Formatting

Iron Contributor

Hello,

 

I have list with Multi-line Enhanced Rich Text column in the list. However, it column text grays out in the bottom. To show entire text in the column, I wanted to apply column formatting. However, while using the following json, it returns HTML format. What will be the best way to fix the issue?

 

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
     "elmType": "div",
     "txtContent": "@currentField",
     "style": {
          "white-space": "normal",
          "padding": "11px 0"
     }
}

 

Thank you,

Bhavpreet Bains

1 Reply

Hi @Bhavpreet Bains,

 

From the Formatting column with long text to multiple-line with word wrap site:

 

Rich text fields return their values with HTML. List Formatting automatically escapes values meaning that these types of fields will include HTML in their text values and that HTML will not be used as part of the page. It is not recommended to use rich text fields with List Formatting.

 

If you turn off "enhanced rich text" the JSON will work as advertised.

 

I hope this helps.

 

Norm