Nested Galleries (Group by) in Power Apps

Loading

Requirement:

Creating a ‘Nested Gallery’ (group by) within the power apps- when click on a particular button inside the gallery the required details of that particular item reflecting inside the gallery by the other gallery
– gallery displaying in a gallery

taking a blank screen in the power apps, within the screen insert a blank ‘flexible gallery’ which it supports the flexible height.

Select the layout as blank gallery

in the ‘item’ property the function is ‘group by’ to get the columns required from the datasource, but within the group by we are not able to fetch the choice column we require, so we are going to use the function ‘addcolumns’ within the ‘groupby’ fn because the datasource in the Sharepoint column which we are required to take is a choice column, so by this ‘addcolumns’ we are fetching the choice column into this .

GroupBy(AddColumns('Company ProductsList', "CompanyText", 'Company '.Value),"CompanyText", "CompanyData")
  • Company ProductList – SP data source
  • CompanyText – which we created to store the text data from the choice column
  • Company – it is the choice column
  • .Value – the values from the choice column
  • CompanyData – the textdata stores into this created source

Insert a button inside the gallery and adjust accordingly, On this button ‘text’ property provide ‘thisitem.companyText” as companyText carries the choice column data from the SP data source

button text property: thisitem.companyText

all the choice fields are carried into the gallery in buttons

Now Insert a gallery into the Gallery which inserted first – named as Initial gallery & second gallery named as Sub gallery

In the item property fn is ‘thisitem.CompanyData’ where it stores the data from the CompanyText ‘groupby’

SubGallery item property : Thisitem.CompanyData

Now insert a text label to show the require data from the source

where as am displaying the product name, product category , an Icon and a product ID

I have made the UI design accordingly

Now to adjust the flexible height for the ‘SubGallery’ i.e the second gallery

On the ‘SubGallery’ Height property use fn

Parent.TemplateHeight-btngal.Height

so the height could be adjustable according to the items in the SubGallery.

Leave a Reply

Your email address will not be published. Required fields are marked *