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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / multiline label and el...
Power Apps
Unanswered

multiline label and ellipsis("...") when text does not fit, wrap property

(0) ShareShare
ReportReport
Posted on by 3

Hi, 

when I have a label which is not big enough to store the text then I can setup my label to put ellipsis ("...") at the end of the text automatically. This can be done with settings:

label.wrap = Off

label.autoHeight=Off

 

 

So when I have very long piece of text  (e.g. "very long text. Very long text"). it just shows, e.g. : 

Very long t...

What I want to achieve is to have the same behavior but for multiple lines (e.g. 2 lines) of text.

I created label which is 3 times as height and I put the same settings (label2.wrap = Off  label2.autoHeight=Off)

Unfortunately this does not work and only single line of text is being displayed (ended with ellipsis). 

 

 

 

labelWrap.png

Does anyone know how this can be achieved?

 

 

 

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @Przemyslaw 
    A canvas-apps component that will solve your issue is available for FREE on the community gallery.   In fact, Emmanuel Gallis (aka R3dkap) has a bunch of awesome components there worth checking-out 🙂

     

    Link to component:

    https://powerusers.microsoft.com/t5/Canvas-Apps-Components-Samples/Auto-Width-Label-Generator/td-p/534187

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Przemyslaw Profile Picture
    3 on at

    hi @mdevaney 

    thanks for this, it is interesting and potentially it might help creating working solution, but I am afraid a lot of effort would be required. Problem with multiple lines is that you never know how powerapp will divide the sentence into multiple lines. Usually powerapp is trying to not divide words if possible, unless your label is very narrow. It would be a lot of hassle to divide the sentence programatically into lines (by adding line feed into the string) to have full control over it and then to add "..." at the very end. 

    I was hoping there is some easier way of doing this, maybe someone else might help here? Thanks for your suggestion.

  • Community Power Platform Member Profile Picture
    on at

    If(Len(ThisItem.Arm_Sl_Name) >= 70; Replace(ThisItem.Arm_Sl_Name; 70; Len(ThisItem.Arm_Sl_Name)-69; "..."); ThisItem.Arm_Sl_Name)

    This formula in labels works, you only show the number of chars you want and then  the "...".
    The "70" you have to change for the number you want, depending on the width.
    Hope it helps


  • Community Power Platform Member Profile Picture
    on at

    Hi. I solved this for using the following
    If(Len(ThisItem.Title)>45, Concatenate(Left(ThisItem.Title,45),"..."),ThisItem.Title)

    Assuming the field is called ThisItem.Title and the length limit is 45 characters

  • kristinegriba Profile Picture
    156 on at

    @Anonymous I tried this and it worked awesome... great idea, too! Thanks!

  • GeetanshuKamboj Profile Picture
    4 on at
    turn onn the wrap property of the text and this will fix the problem.
  • Yapski_ Profile Picture
    4 on at

    Changing the 'Wrap' property to 'false' solved the issue for me.
    Thx for the hint!

  • TomLanz Profile Picture
    9 on at

    I came up with another approach here that's a little more involved, but results in a more flexible and nicer (I think) looking UI:

    TomLanz_0-1693948467971.png

    I dropped my variable length text label inside a fixed height container. The text label is set to wrap, and auto-height. Also in the container is a transparent-to-white fade svg image that sits over the top of the text label, but is only visible if the text label height exceeds the container height. So three lines of text will show, but if it stretches to four, then it fades out. 

    This has the benefits of using all available space, still giving the visual queue that there's more available, and also scales if your app UI is responsive. 

     

     

     

  • kristinegriba Profile Picture
    156 on at

    This sounds like a very appealing approach. I am currently working on an app where I will need to introduce some kind of feature just like this, and I think I will give that a whirl when the time comes. I agree that it would be a nicer UI.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard