Creating Nested Galleries in Power Apps. (Parent-Child Relationship)
This is another most common scenario where in client has two parent child lists or any two lists having a common SharePoint column. And clients wishes to have a relationship on the PowerApps screen where in when he/she selects a particular lets say Program in our example. All the respective Projects following that Projects are shown.
In such a scenario we can leverage nested galleries.
So what we do in here is we add two galleries on our Power App screen.
For Programs gallery the Left one on the screenshot above, we connect it to the Programs list
So what we do in here is we set the Program's column value in Project's list equal to the Selected Program of left Gallery. i.e. the gallery connected to my Program's list.
A more complex version of the same is where you inset the nested gallery inside your parent gallery.
In this too everything remains the same except that here we leverage ThisItem instead of Gallery.Selected as the nested gallery remains inside the parent gallery.
So in the above case your items property for nested gallery becomes like. below.
Filter(Projects, Programs.Value = ThisItem.Title).
You can also play around and make the nested Gallery height as dynamic with the below formula
If(CountRows(ProjectsGallery.AllItems) > 0, CountRows(ProjectsGallery.AllItems) * 100,0)
So if you have 4 items the length of your nested gallery is dynamically increased.
happy Smashing.
Comments
Post a Comment