web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I show child re...
Power Apps
Unanswered

How do I show child records in a gallery?

(0) ShareShare
ReportReport
Posted on by 114
I have parent child tables, and I want to show one gallery of the parent records, so that when the user clicks on it, to show all the child records, I guess in another gallery. I heard of the concept of sub galleries, but I'm unsure of what to set the items property of the subgallery (or second gallery).
And the second requirement is, what if i wanted to let the user be allowed to edit the child records, when the parent record is selected. Can the child gallery be made editable? If not Im presume that the child records need to be shown on an edit form and can only be shown (and edited) one at a time when the child record is selected?
Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @bpw without knowing anything about your data, your data source, or your app, but assuming you want both the Parent Gallery and the Child Gallery to be on the same screen, and you do have a field which links both records together:

     

    One method:

    1. Create a Gallery and set the Items property to your data source which contains the parent data

    2. On the OnSelect property of the Parent Gallery, enter

     

    Set(ThisSelectedItem,ThisItem.'Your common field')

     

     

    3. Create a Gallery and set the Items property to your data source which contains the child data

    4. In the Items property of the Child Gallery, enter:

     

    Filter(
     'Your child data',
     'Your common field' = ThisSelectedItem
    )

     

     

    5. Set the Default property of the Parent Gallery to:

     

    {}

     

     

    6. (Optional), set the OnVisible property of the Screen to:

     

    Reset('Your Parent Gallery');
    Set(
     ThisSelectedItem,
     Blank()
    );

     

     

    Another simpler method: 

     

    Filter(
     'Your child data',
     'Your common field' = 'Your Parent Gallery'.Selected.'Your common field'
    )

     

     

    If your data source is Dataverse, the above process is slightly different, but the same overall principle applies.

     

    Regarding the second question, you could make the 2nd Child Gallery editable, but unless you need to update multiple records at a time, I would recommend creating a Form which is associated to the selected item in the 2nd Child Gallery.

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • bp3378 Profile Picture
    114 on at

    Thank you this should be very helpful!

  • bp3378 Profile Picture
    114 on at

    Thanks that worked!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard