SPO Modern JSON - Format a Multiline Text Field that Uses Enhanced RTF

Crazy Dance 20 Reputation points
2023-07-01T03:45:55.74+00:00

Hello Community,

I am working in SharePoint Online Modern, and I am building a JSON Formatted List View. In the list, there are several Multi-Line Text Fields that use Enhanced Rich Text. Some of these fields contain hyperlinks formatted in HTML. When I display those field's values, I get the following kind of results:

User's image

Here is my JSON code:

			  {
				"elmType": "div",
				"attributes": {
				  "class": "sp-row-listPadding"
				},
				"style": {
				  "padding": ".75em",
				  "font-weight": "Bold"
				},
				"txtContent": "System Description"
			  },
			  {
				"elmType": "div",
				"attributes": {
				  "class": "sp-row-listPadding"
				},
				"style": {
				  "padding": ".75em"
				},
				"txtContent": "[$System_x0020_Description]"
			  }

Has any else found a way to build a view with JSON and Enhanced Rich Text and been able to display the HTML properly? If so, please provide guidance and examples.

Thanks!

Tom

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,994 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,861 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,846 Reputation points
    2023-07-03T08:09:55.46+00:00

    Hi Crazy Dance

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

    It is not recommended to use rich text fields with List Formatting.

    And according to this Microsoft article, multi-line text column with enhanced rich text is not supported within JSON column formatting.

    So I suggest you apply JSON formatting to plain text column.

    If you want this by OOTB, I suggest you can raise a thread in the SharePoint feedback portal.

    Hope this helps. Best Wishes.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments