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 does a gallery get...
Power Apps
Unanswered

How does a gallery get a flexible width depending on the loaded data?

(0) ShareShare
ReportReport
Posted on by 126

Hi, everyone,

 

hope someone can help me with this. Is it somehow possible to make the width of a gallery dependent on the loaded data?

 

SharePoint data is loaded in my gallery. A maximum of three data records are loaded in three columns. However, if there is only one or two instead of three data records for a day (display of the data records, depending on the selection in the DatePicker), I have the problem that the neighboring labels, which calculate the sum of the data from the gallery on the right Screen stuck because the gallery has a fixed width regardless of the data set loaded.

 

This leads to a blank space in the display. At best, it should be the case that the gallery width is dynamically dependent on how many data sets have actually been loaded.

 

Hope that was understandable.

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @Livearus ,

    I think that is pure math. 

    I imagine that the first gallery is a horizontal one. You need to set the Width property of the that gallery based on items rows number. It should look like:

    With(
     {galleryItems:formulaFromGalleryItemsProperty},
     Self.TemplateWidth*CountRows(galleryItems)
    )

    I used this formula to avoid delegation warning.

    And the second gallery should have the Y property set as Gallery1.X+Gallery.Width.

     

    Hope it helps !

  • Livearus Profile Picture
    126 on at

    I thank you in advance for your help. Unfortunately I don't understand your solution. It's also the case that I'm not very familiar with PowerApps and the functional possibility.

     

    What is "galleryItems", which property? Where does it come from? This is not recognized by me. Likewise "formulaFromGalleryItemsProperty", is that a placeholder? What do you mean by that? This also gives me an error message.

     

    The gallery is named: "gallery3".

     

    I hope you can make it easier to understand for a beginner.

     

    Regards

  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @Livearus 

    galleryItems is just a temporary variable used inside formula.

    formulaFromGalleryItemsProperty - is the same formula you used in Items property of gallery3.

      

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