How to make SharePoint List Multiline column only show the first few lines

Wang, Ivana 0 Reputation points
2024-05-03T13:07:37.7733333+00:00

I don't want all text to display on the SharePoint List multiline column but I don't know how to make it show less text as a preview. I want the text form to be rich text and I found that if I added a scroll, it did not fit with rich text.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,810 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
599 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Emily Du-MSFT 47,296 Reputation points Microsoft Vendor
    2024-05-06T07:57:34.9533333+00:00

    By default, multiple line of text column with enhanced rich text is not supported with JSON formatting. JSON formatting is only available with multiple line of text column with plain text.

    As a workaround, add a scroll for multiple line of text column with plain text by using below JSON codes.

    {
        "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column formatting.schema.json",
        "debugMode": true,
        "elmType": "div",
        "children": [
          {
         "elmType": "div",
            "txtContent": "@currentField",
            "style": {
                     "padding":"11px 8px",
                     "max-height":"64px",
                    "overflow-y":"auto",
                    "align-items":"flex-start"
             }
          }
        ]
     }
    

    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.

    2 people found this answer helpful.

  2. Shawn Collins 615 Reputation points
    2024-05-03T20:18:12.88+00:00

    If you want to display a preview of text in a SharePoint List multiline column without showing the entire content, you can use a calculated column to achieve this. Here's a general approach:

    Create a Calculated Column: Create a new calculated column in your SharePoint List.

    Use a Formula to Extract Preview: In the formula for the calculated column, you can use a combination of functions to extract a portion of the text as a preview. For example, you can use the LEFT function to extract the first few characters of the text.Here's a sample formula:

    =LEFT([YourMultilineColumn], 100)

    This formula will extract the first 100 characters from your multiline column. You can adjust the number "100" to fit your desired preview length.

    Set the Calculated Column to Display as Rich Text: Make sure to configure the calculated column to display as rich text if you want to maintain the rich text formatting.

    Hide the Original Multiline Column: Optionally, you can hide the original multiline column from the list view if you don't want it to be displayed alongside the preview.

    By using this approach, you can display a preview of the text in your multiline column while still maintaining the rich text formatting. Users can then click on the preview to view the full content if needed. Adjust the formula and preview length as necessary to fit your requirements.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.