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 / How to create auto hei...
Power Apps
Unanswered

How to create auto height for containers

(0) ShareShare
ReportReport
Posted on by 11

Hi I am struggling with an idea, how to automatically expand container horizontally depending on how many elements are in it. My scenario:

  • I have one main container that will be scrollable
  • Within the main container, I have Sub containers (sections)
  • Each Sub container contains different elements stacked on top of each other vertically.

Requirements:

I want to auto adjust sub containers depending on how many buttons there are on top of each other for ex. My idea was, that I would do "ForAll" function on all child elements of "Sub1", there I would get reference to every button, get its height, and add everything together. so if one button has height of 30px, multiply it by 4, that is 120px and that would the be the height of the container. The moment, one button is hidden dynamically, height of the container would be 30x3 = 90px

 

Problem is, I have no idea, how to get child elements of a parent. I wanted to do something like:
Screen4.Main.Sub1.Items

 

I cannot use other lists/collections where I would be storing elements of each section, because that will be a nightmare to handle. I will be storing different sections with different heights. 😞 Please, do you have any other idea, how to get list of children elements dynamically?

 

img2.png

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    @PeterFridrich there probably isn't a way to do that. You would have to write the expressions factoring in each sub-container and using their Visible property to conditionally define the height. 

     

    ---
    If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

     

    Thanks!

    Hardit Bhatia

    Microsoft Business Applications MVP

    Microsoft Certified Trainer MCT

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

  • PeterFridrich Profile Picture
    11 on at

    that's unfortunate. I wish MS would provide us a way how to get elements within an app starting from screens down to all other elements. thank you

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 402

#2
WarrenBelz Profile Picture

WarrenBelz 380 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 293 Super User 2025 Season 2

Last 30 days Overall leaderboard