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 / Auto Height issue of L...
Power Apps
Answered

Auto Height issue of Label, HTML Text

(0) ShareShare
ReportReport
Posted on by 9

I am in trouble with the auto height property of label.  I have placed a label with auto height inside a flexible height gallery.  The label auto height work some times and later it stopped working.  Then I tried replacing the label with HTML Text.   But the result is same.  It works some time and not works most of the time.   Is this a bug ?  Is there any workaround ?

Categories:
  • eka24 Profile Picture
    20,925 on at

    Under what scenario does it fail to work, any screenshot.

    What about trying flexible height Gallery

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Anil_edacheri Profile Picture
    9 on at

    Hi I have used a Flexible Height Gallery and placed another Flexible Height Gallery to display the detail data.  The label and later HTML Text was placed inside the second Gallery.  The image is attached.

    Capture.JPG
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anil_edacheri :

    Could you tell me :

    • What is the lable control's height property?
    • What is the lable gallery's height property?

    I made a test but did not encounted the problem you mentioned.

    1\add a gallery

    2\add a lable control into this gallery and set it's height property to:

     

    Parent.Height/7

     

    24.gif

    The height of the label changes with the change of the gallery

    Best Regards,

    Bof

  • Anil_edacheri Profile Picture
    9 on at
    • What is the lable control's height property?

       Label's height is 40.  However I have opted for Auto Height= On

    • What is the lable gallery's height property?

           Gallery is Flexible height Gallery.  However, since it was not growing,  I tried to find the sum of height of label placed inside the gallery and set the value.  

    Gallery6.Height = Max(50,Sum(Gallery6.AllItems,Value(Label17.Text))+(CountRows(ThisItem.Colgrp)*10))

    Label17.text is the height of label. Colgrp is the source for the gallery.

    Please refer the attached images.

    label16 Property.JPG
    Gallery.JPG
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anil_edacheri :

    I am not quite sure why AutoHeight does not work, because I did the test here, but I did not encounter the problem you mentioned.

    To solve this problem, maybe you can try this solution:

    My data source:

     

    ClearCollect(ddddd,{V:"agagwerhgshfds"},{V:"agagwerhgshfdshfgdjfgdjds"},{V:"agagweasgsfdhfdshfdjhfgkjghlklrhgshfdshfgdjfgdjds"})

     

    Add a label into the gallery and set it's Height property to:

     

    RoundUp(Len(ThisItem.V)/11,0)*36

     

    The focus of this solution is to dynamically adjust the height of the label based on the length of the string in the label control.

    1.JPG

    Best Regards,

    Bof

     

  • Anil_edacheri Profile Picture
    9 on at

    Many Thanks.

    This workaround has solved my issue. 

  • chico Profile Picture
    638 on at

    This looks like a great solution, 
    can you expand on why or how you determined the values for the division and multiplication..?

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard