Multiline Text box limit number of words

Krishna Sandeep Sangani 61 Reputation points
2024-08-12T16:09:35.9933333+00:00

Hi All,

SharePoint Modern lists display takes lot of space when we have more data in Multiline text boxes.

Is there any way we can limit the number of Characters display in List view, so that we can overcome huge gaps between list item entries.

Appreciated if any suggestions.

Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2024-08-13T02:55:30.94+00:00

    Hi @Krishna Sandeep Sangani,

    You can implement a visual indicator or validation to enforce a character limit using JSON formatting. Here’s an example JSON snippet to truncate a multiline text field to 100 characters:

    {
        "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
        "elmType": "div",
        "txtContent": "=substring(@currentField, 0, 100) + if(length(@currentField) > 100, '...', '')",
        "style": {
            "white-space": "nowrap",
            "overflow": "hidden",
            "text-overflow": "ellipsis"
        }
    }
    

    Please refer to the document

    https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting


    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

  2. Krishna Sandeep Sangani 61 Reputation points
    2024-08-13T21:25:57.84+00:00

    This is a rich text column, when we add above JSON in formatting it is showing <div class="Externalclass">.

    Can we change formula to overcome those div tags?


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.