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 / Manage Embedded Galler...
Power Apps
Answered

Manage Embedded Gallery Height

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

I have a Gallery inside a Gallery.

I have a distinct filter in the main gallery, the displays the names of chaperones.

The embedded gallery holds the names of children.

A chaperone may be responsible for one or more children. 

Is there a way to control the 'Height' of the embedded gallery, maybe with a 'CountRows'
formula. Example If the number of children (rows) is 4 - Height = 400,
                             If the number of children (rows) is 3 - Height = 300,
                             If the number of children (rows) is 2 - Height = 200,
                             If the number of children (rows) is 1 - Height = 100,

 

Phineas_0-1703806870103.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,924 Most Valuable Professional on at

    @Phineas ,

    Normally the Gallery Height to match the number of records would be

    CountRows(Self.AllItems) * (Self.TemplateHeight + Self.TemplatePadding *2)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @Phineas 

     

    You're spot on with the approach. You can use something like this in the nested gallery height:

     

    Self.AllItemsCount * 30 (assuming your template height was 30)

     

    or you can dynamically pass the template height / size in instead.

     

    Watch out for template padding - easiest way is if you can set that to 0 and the above will work as is or if you really need padding, be sure to add it to the calculation so it would then be something like:

     

    (Self.AllItemsCount * (30 + Self.TemplatePadding)) + Self.TemplatePadding (last one added to account for one more instance of template padding in addition to the nr of rows in your gallery)

     

    Hope this helps

     

  • Phineas Profile Picture
    5,331 Moderator on at

    The first entry in the Gallery has four children, and the embedded gallery fits/looks fine with the code below (Gallery Height 212/Gallery Template Size 53).

    Formula -
         CountRows(Self.AllItems) * (Self.TemplateHeight)

    Any sub-gallery that has three or fewer (see below) is not adjusting/reducing in size based on the fewer items.

    I want the embedded gallery to shrink expand based on the number of items in the embedded gallery.

    Phineas_0-1703810619158.png

     

  • Phineas Profile Picture
    5,331 Moderator on at

    My response to your suggestion is the same as my response to @WarrenBelz  .

    The first item (which has four children) in the embedded sub-gallery fits fine; However, when I get to a gallery with less the four the height of the gallery is no reducing, and there is space left after the last item in the gallery - it is this space I am trying to eliminate.

    Phineas_5-1703813095932.png

     

     

     

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @Phineas 

     

    I think the code we have given you is working, but the issue may be the 'Template size' of your parent gallery, which may be at the default of 280? - assuming you are using a flexible height gallery for the parent, you will just need to change the default size to a value which is always lower that the max height of rows content in the parent Gallery.

     

    Hope this make sense / is helpful.

     

    @WarrenBelz sorry, I was drafting my initial response and didn't know you had responded.

  • Verified answer
    WarrenBelz Profile Picture
    154,924 Most Valuable Professional on at

    @Phineas ,

    Just tested here and that is actually correct as the all sub-galleries will take the height of the largest one. There is no solution to this as galleries do not have an AutoHeight function like a Text Label which will work in a Flexible Height Gallery.

    @AmDev is also correct on the Height formula (I looked back one I did some time ago)

    CountRows(Self.AllItems) * (Self.TemplateHeight + Self.TemplatePadding) + Self.TemplatePadding

     

  • Phineas Profile Picture
    5,331 Moderator on at

    To make sure I understand, the embedded gallery will always be as high/long as the largest embedded gallery, yes?

    There is no way to 'individualize' the maximum, height of the embedded gallery per item, based on the number of rows in each embedded gallery, yes?

  • Verified answer
    WarrenBelz Profile Picture
    154,924 Most Valuable Professional on at

    @Phineas ,

    That is correct and what testing I did here also confirmed. There is simply no setting/code that will address individual galleries.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard