cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Livearus
Helper III
Helper III

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions

@Livearus 

galleryItems is just a temporary variable used inside formula.

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

  

View solution in original post

3 REPLIES 3
gabibalaban
Dual Super User
Dual Super User

@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 !

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

@Livearus 

galleryItems is just a temporary variable used inside formula.

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

  

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,605)