Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Data aggregation in a Galery



I need to aggregate data in a powerApps Gallery.

For example I have a level with countries = main Gallery, and for each country I have one or more cities = subGallery.


Number of cities for a country is not always the same :




For each row in the SubGallery I want to click and show details for the selected city


Have any ideas ?



Dual Super User
Dual Super User

Data isn't actually stored in a gallery.  The Gallery just shows the filtered data that is stored in a data source or collection behind the scenes. So for your requirements I would use two galleries and a data form or table.  Assuming you have two data sources, where the first is a list of countries and cities and the second is a list of Cities with their information.  Then you would add one gallery to the page and show the list of the cities sorted by country.  In the second gallery you would show a list of cities for the country selected in gallery #1. (Note, you could do this with just one gallery showing countries with each city).  Then in the final form or data table you would show the city that is selected in Gallery #2.


To do this just set the data source property of the Gallery or form to the appropriate data source and then set the items or item based on the selected item in the gallery above using a Filter or Lookup.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Super User
Super User

With 2 Galleries:

  1. MainGallery items to MainDatasource: Counteries
  2. SubGallery items to Filter(SubDatasouce,CountryName=MainGallery.Selected. CountryName)
  3. Note: MainDatasource has Only Counteries and SubDatasource has both countries and cities



Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,598)