Multiline Enhanced Rich Text and Column Formatting

%3CLINGO-SUB%20id%3D%22lingo-sub-908569%22%20slang%3D%22en-US%22%3EMultiline%20Enhanced%20Rich%20Text%20and%20Column%20Formatting%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-908569%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20list%20with%20Multi-line%20Enhanced%20Rich%20Text%20column%20in%20the%20list.%20However%2C%20it%20column%20text%20grays%20out%20in%20the%20bottom.%20To%20show%20entire%20text%20in%20the%20column%2C%20I%20wanted%20to%20apply%20column%20formatting.%20However%2C%20while%20using%20the%20following%20json%2C%20it%20returns%20HTML%20format.%20What%20will%20be%20the%20best%20way%20to%20fix%20the%20issue%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%22%24schema%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%3C%2FA%3E%22%2C%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%22txtContent%22%3A%20%22%40currentField%22%2C%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%22style%22%3A%20%7B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%22white-space%22%3A%20%22normal%22%2C%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%22padding%22%3A%20%2211px%200%22%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%7D%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3CP%3EBhavpreet%20Bains%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-908569%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-910032%22%20slang%3D%22en-US%22%3ERe%3A%20Multiline%20Enhanced%20Rich%20Text%20and%20Column%20Formatting%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-910032%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F45180%22%20target%3D%22_blank%22%3E%40Bhavpreet%20Bains%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrom%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-list-formatting%2Ftree%2Fmaster%2Fcolumn-samples%2Ftext-wrap-format%23additional-notes%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EFormatting%20column%20with%20long%20text%20to%20multiple-line%20with%20word%20wrap%3C%2FA%3E%26nbsp%3Bsite%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ERich%20text%20fields%20return%20their%20values%20with%20HTML.%20List%20Formatting%20automatically%20escapes%20values%20meaning%20that%20these%20types%20of%20fields%20will%20include%20HTML%20in%20their%20text%20values%20and%20that%20HTML%20will%20not%20be%20used%20as%20part%20of%20the%20page.%20It%20is%20not%20recommended%20to%20use%20rich%20text%20fields%20with%20List%20Formatting.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20you%20turn%20off%20%22enhanced%20rich%20text%22%20the%20JSON%20will%20work%20as%20advertised.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20hope%20this%20helps.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ENorm%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent 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
Highlighted

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