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 / Parent/Child Gallery R...
Power Apps
Unanswered

Parent/Child Gallery Relationships for Height

(3) ShareShare
ReportReport
Posted on by 55
Hello!
I am trying to build a relationship between a parent gallery & child gallery. Particularly I want to remove scrolling in the child gallery, meaning making each section have flexible heights based on the number of items in the child gallery. 

PARENT GALLERY
Blank flexible height gallery
Items: Distinct('SharePoint',Title)
Height: 950
Template size: 250
1 text label (height: 44)

CHILD GALLERY
Blank vertical gallery
Items: Filter('SharePoint', ThisItem.Value = Title)
Height: CountRows(Filter('SharePoint', ThisItem.Value = Title)) * 64
Template size: 64
1 checkbox (height: 40) & 1 text label (height: 30)

How can I adjust my heights and template sizes to remove the scrolling in the child galleries & only have scrolling in the parent gallery? Currently each child is overlapping over the next parent (or has way too much vertical space before the next parent).  Thanks!
Categories:
I have the same question (0)
  • vipuljain03 Profile Picture
    647 Super User 2025 Season 2 on at
    PARENT GALLERY
    Blank flexible height gallery
    Items: Distinct('SharePoint',Title)=> this is correct
    Height: 950 => Remove any fixed height you have here. Let it be dynamic. Power Apps will calculate the height based on its contents.
    Template size: 250 => This is crucial. Set this to a dynamic value based on the child gallery's content. Use the below formula:
    CountRows(Filter('SharePoint', ThisItem.Value = Title)) * 64 + 44 // 64 is child template height, 44 is the label height
    1 text label (height: 44)
    Inside the template, place your label (height 44) and then the child gallery.
     
    Child Gallery
    Items: Filter('SharePoint', ThisItem.Value = Title) => this is correct
    Height: CountRows(Filter('SharePoint', ThisItem.Value = Title)) * 64 => Remove any height setting you have here. It should be blank. The parent gallery template's height will control the child gallery's height.
    Template size: 64 => this is correct
    1 checkbox (height: 40) & 1 text label (height: 30) => Make sure these heights add up to your template height (64 in this case). Checkbox (height 40) and Text Label (height 30)
     
    ---------------------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
     
    Thanks,
    Vipul
     
  • dsopshin Profile Picture
    55 on at
    @vipuljain03
    Thank you for the response! I am still having a few issues. 
     
    I am trying to use this formula, but I get an error that just says: the "." operator cannot be used on Error values.
     
    CountRows(Filter('SharePoint', ThisItem.Value = Title)) * 64 + 44 // 64 is child template height, 44 is the label height
     
    Also, for the height, when you say "Power Apps will calculate the height based on its contents." - what do I put in the field? If I leave it blank, it defaults to 0 which makes it completely invisible. 
     
    Thanks!
     
  • AjithBhaskar Profile Picture
    3 on at
     
    @dsopshin

    To answer your questions 

    How can I adjust my heights and template sizes to remove the scrolling in the child galleries & only have scrolling in the parent gallery?

    For the PARENT GALLERY 
    You are using a blank flexible height gallery

    Height: You can set this to your desired value

    Template size: You can set this to 0 or any value as per your preference as this value is going to be dynamic

    There is one more property Template padding - Set it as you wish. This should be the one determining the space between each item(space between the first child gallery and second parent text label)


    For the CHILD GALLERY  You are using a blank vertical gallery

    In this gallery you need to adjust Template padding as per your wish. This should be the one determining the space between each item within the child gallery.

    Height: Here the height should be the summation of ((template size +template padding) * CountRows(no.of items)) + TemplatePadding(Added this for the padding created at the beginning of the Gallery)
     
    (CountRows(Filter('SharePoint', ThisItem.Value = Title))*(Self.TemplateHeight+Self.TemplatePadding))+Self.TemplatePadding

    If Self.Templateheight or Self.templatepadding is not working please use the galley name in place of self (i.e Galleryname.TemplateHeight).

    Template size Please check if the checkbox and text label are within this template size.


    Currently each child is overlapping over the next parent (or has way too much vertical space before the next parent).

    If you are seeing this in edit mode it is the expected behaviour of a blank flexible height gallery. So please check this in the Play mode or in the published version.

    If this answers your question , please give it a like so that it helps others in the community

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