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 / Set Label.height to 0 ...
Power Apps
Answered

Set Label.height to 0 if blank, but Auto height if below a certain number, and then also have a max size?

(0) ShareShare
ReportReport
Posted on by 235

Hey everyone.

 

I have a gallery with a text label. I would like the text label.height to be 0 if it is blank, but I would also like it to have auto height True if the height is between a certain number. And then I would like it to have a max height. For example between 1 and 140 would be flexible. and then 140 would be the max size and scrolling would be enabled if it was any larger. Hope that makes sense. Any idea how I can accomplish this? I've tried a bunch of different idea with no solution.

 

Thanks!!

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @Charliemacdmv  I don't think AutoHeight and a min/max height condition is possible.
    A workaround could be working with 2 conditional labels.

    (1) We will use the first label for the auto height functionality.

    //(1) The label will only show if not blank and if label2 is not visible
    !IsBlank(Self.Text) && !Label2.Visible
    
    //(2) auto height property will be true
    true


    (2) The second label will only show once we have reached the max height threshold:

    (1) Visible property:
    Label1.Height > 140


    The second label would have a static height and be scrollable.

    I hope this helps!

  • Charliemacdmv Profile Picture
    235 on at

    @LaurensM  OMG Why didn't I think of that lol. You get so stuck on one thought... Thank you!!  That will work for sure.

  • LaurensM Profile Picture
    12,516 Moderator on at

    @Charliemacdmv happens to all of us, sometimes you just need another pair of eyes to look at the issue 😉

    If it fully solves your problem, would you be so kind as to mark/accept it as a solution?
    This also helps the community members, in case they run into a similar issue.

    Thanks!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard