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 Apps / Maximise the amount of...
Power Apps
Answered

Maximise the amount of text in a label before cutting off the message

(0) ShareShare
ReportReport
Posted on by

Hi there

 

I have a label in a gallery. The dimensions are, for example, 113w x 33h. Wrap = On.

 

The font is OpenSans size 10, which allows me to fill up to two lines of text.

 

How can I maximise the number of characters that appears within this label over two lines using a formula in the Text property such as:

 

Left(ThisItem.ColumnName,24)

 

where 24 is a relative number that depends on the width of the characters.

 

That is, if ColumnName.Text = "AAAAAAAAAAA AAAAAAAAAAA AAAAAAAAA AAAAAA", I can fit about 24 characters, but if ColumnName.Text = "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII", I could fit perhaps 50 characters before I would need to trim the text.

 

Thanks!

Categories:
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Labels will auto-trim themselves based on the amount of space they have available, you don't need to specify how many characters to trim.

     

    If you want users to be able to view the larger text I would suggest putting it in the ToolTip for the label

     

    Cheers,

    Sancho

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @pa111

    Consider using the tooltext property instead. It can hold 1000+characters and doesn't take up any real estate. 

  • pa111 Profile Picture
    on at

    Thank you @iAm_ManCat and @Drrickryp for your replies.

     

    I am using the Tooltip to display the full value of the text.

     

    For the visible component, previously I had VerticalAlign = Middle. This meant that:

    • If there is a single row, it appears in the middle of the gallery row
    • If there are two rows, they appear above and below
    • If there are three rows, the top and bottom get clipped

    pa111_0-1679379247294.png

     

    If I change VerticalAlign = Top, then:

    • If there is a single row, it appears at the top of the gallery row
    • If there are two rows, the top two rows display
    • If there are three rows, the top two rows display

    pa111_1-1679379318878.png

     

    This is a good result, but an even better result would be that for one row, it displays in the middle of the row (per VerticalAlign = Middle), and for more than one row, is displays per VerticalAlign = Top.

     

    Is this possible to achieve? If not, I will change it to VerticalAlign = Top.

     

    Thanks again

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    There's no easy way to do that unfortunately - you'd have to make a case for every character and special character in the ASCII table, and then you'd also have to make it consider what the font size has an impact on that, and also the font itself - not all letters are the same width across those dimensions.

     

    In your case I would stick to VerticalAlign:Top

     

    Your other options is to create a flexible-height gallery where each row can expand to the height its needed and then set Autoheight to true for the label - but that's only if you are ok with the rows being different heights.

     

    Cheers,

    Sancho

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard