web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to limit displayed...
Power Pages
Answered

How to limit displayed text of a field of type "Multiple Lines of Text"

(0) ShareShare
ReportReport
Posted on by 21

I have a custom view on Contact displayed as a list on a page.

 

One of the fields is of type "Multiple Lines of Text"and I'd like to display the only the first characters followed by three periods

 

For example if the saved text is:

"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. "

The list should only display:
"The quick brown fox jumps over ... "

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,449 Most Valuable Professional on at

    Hi, a few points here:

    • would you like the data to be saved in dataverse like that? or is this just when displaying?
    • will the user be able to view the entire text or just the first X chars? 

     

  • zen37 Profile Picture
    21 on at

    just when displaying

    view just the first X chars if not logged in

  • Verified answer
    oliver.rodrigues Profile Picture
    9,449 Most Valuable Professional on at

    Hi, you can try the below code:

    $(document).ready(function () {
    
     var userId = "{{ user.Id }}";
     if(!!!userId)
     {
     SetMaxText("YOUR COLUMN NAME", 5);
     }
    });
    
    function SetMaxText(columnName, maxChars) {
     var column = $("#" + columnName);
     if (!!column) {
     var currentText = column.text();
     if (currentText.length > maxChars) {
     var newText = currentText.substring(0, maxChars) + "...";
     column.text(newText);
     column.val(newText);
     }
     }
    };

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 51

#2
rezarizvii Profile Picture

rezarizvii 35

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 29 Most Valuable Professional

Last 30 days Overall leaderboard