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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,687)