Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Template size of a gallery

(1) ShareShare
ReportReport
Posted on by 194
Hi all, 
 
Does anyone have any experience with dynamically sizing the template size of a gallery based on the number of rows in the gallery?
 
I'm trying to size the height of the template size based on the number of rows divided by the height of the actually gallery, can this be done?
  • Verified answer
    CarlosFigueira Profile Picture
    on at
    Template size of a gallery
    What is the 'Items' property in your gallery? Does it reference one of the gallery's own properties?
  • DerrickH Profile Picture
    194 on at
    Template size of a gallery
    Thanks!  though I'm getting an error on the TemplateSize property. 
     
    Formula:  Self.Height/Self.AllItemsCount
     
    Error:  "This rule creates a circular reference between properties, which is not allowed.  A property cannot reference itself or other properties affected by its value."
  • Suggested answer
    CarlosFigueira Profile Picture
    on at
    Template size of a gallery
    You can set the TemplateSize property of the gallery to a formula like the one below to do that:
     
    Self.Height / Self.AllItemsCount
     
    This would make the gallery template resize depending on the number of rows:
     
     
    Hope this helps!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard