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 / Auto height for label ...
Power Apps
Unanswered

Auto height for label not working in gallery

(0) ShareShare
ReportReport
Posted on by 367

Hi all -

 

I am not sure if there is a way to grow this label. I selected auto height but the textbox does not seem to grow. 

This is in a blank gallery.

I tried to follow https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/gallery-dynamic-sizing but it didn't work.

 

- is it possible to grow this label and the corresponding text box?

- can i shrink the box if the label is empty? 

 

Bunly11_0-1600921263494.png

 

Thanks

 

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi@Bunly11,

    Based on the issue that you mentioned, do you want to make the Label automatically adjust the row of the Gallery?

    Could you please share a bit more about the scenario, do you mean that you want to enlarge the Label to display all the text within?

    Actually, the AutoHeight property was designed to estimate the content size and to adjust its height accordingly. A row within a Gallery might also be taller than you expect if it contains a control for which the AutoHeight property is set to true. 

    If my understanding is correct, what you want is to change the template size of the gallery based on the data in the Label. As for that you also want to shrink the box if the label is empty, I am afraid that there is no way to achieve this in PowerApps currently.

    In a word, surely you could make the Label auto high, while it is impossible to adjust the Label to shrink when it is empty.

    I have a test on my side, please take a try as below.

    • Set the Label AutoHeight property: true
    • Find and copy the expression in the Y property of your needed Label
    • Put the copy result in Gallery TemplateSize property and do an addition:

     

    Min(168, Self.Height - 60)+Subtitle1.Y + Subtitle1.Height + 4​

     

    002.png003.png

    Best Regards,

    Qi

  • Bunly11 Profile Picture
    367 on at

    Hi @v-qiaqi-msft 

     

    I tried what you suggested below but the htmltext box didn't grow. Is it because there is another datacard below it?

    Should I put something in the height of the datacard?

     

    Thank you

     

    Bunly11_0-1601527188067.png

     

    Bunly11_1-1601527379069.png

     

     

     

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi@Bunly11,

    Sorry for the late reply. I have just come back from my vocation.

    Combine that with your description, I just provide a solution that makes the Label within the data card auto high rather than the HTML text box. If you want to also make the HTML text box auto high, you should add something else.

    I have a test on my side, please take a try as below.

    • Set the HTMLText AutoHeight property: true
    • Find and copy the expression in the Y property of your needed HTMLText
    • Put the copy result in Gallery TemplateSize property and do an addition:

     

    GalleryTemplateSizeValue+LabelYpropertyValue+HTMLTextYpropertyValue​

     

    Screenshot 2020-10-08 102250.png

    Best Regards,

    Qi

  • Bunly11 Profile Picture
    367 on at

    Hi @v-qiaqi-msft 

    I tried that but now the htmltextbox lost the scroll bar and I am not able to see the additional information in the box.

    The datacard/gallery are not shrinking.

    Bunly11_1-1602194839576.png

    With autoheight off i get the scrollbar

    Bunly11_4-1602195004226.png

     

    This is that I put in the gallery template size

     

    Bunly11_2-1602194928992.png

     

    Thanks

     

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi@Bunly11,

    Could you please tell me:

    1. Do you have a ScrollableScreen?
    2. Do you copy a Gallery to the data card?

    Let me make it easy for you. Actually, inserting a Gallery into a data card is not allowed while the users could copy and paste it to the data card. What you have done is a bug in PowerApps. Since you have inserted a Gallery to a data card which could cause some functions not working.

    Also, the HTMLText has the height limit, the AutoHeight property will not work once the cap is exceeded.

    As an alternative solution, you could consider setting the AutoHeight property of the HTMLText as "false", and then you could scroll it to view all the content within.

    Hope it could help you.

    Best Regards,

    Qi

  • Bunly11 Profile Picture
    367 on at

    Hi @v-qiaqi-msft 

    1. Do you have a ScrollableScreen? yes
    2. Do you copy a Gallery to the data card? yes

    This was the only way I could figure out after searching on google. I have 60+ items I want to display on a scrollable screen. 

    I have currently 3 datacards with gallery inserted. Is there a better way?

     

    Capture.JPG

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi@Bunly11,

    I am afraid there is no direct way to achieve this currently in PowerApps.

    As I mentioned before, you could consider setting the AutoHeight property of the HTMLText as "false", and then you could scroll it to view all the content within.

    For the Label auto height, you could try the previous solution I provided. 

    Best Regards,

    Qi

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard