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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter a gallery using...
Power Apps
Answered

Filter a gallery using a parent gallery when using Dataverse tables

(0) ShareShare
ReportReport
Posted on by 16

I'm trying to display two galleries. The first gallery is the parent gallery and the second gallery is the child gallery. So when an item in the first gallery is selected then the second gallery should show all the related child records. The tables are dataverse tables. 

 

It looks like the solution is to filter the second child gallery so item=Filter('child table',  field_from_child_table = galleryParent.selected.field_from_parent_table). 

 

The problem I'm having is when setting the one-to-many relationship between the parent and child table in the dataverse I did not specifically relate two fields as containing the relationship. I do not know which fields I'm supposed to specify as containing the relationship. 

 

I need help setting both the child field and the parent field in the filter when using dataverse tables. 

 

Thanks 

Categories:
I have the same question (0)
  • Verified answer
    Muhanned Profile Picture
    on at

    Hi @dj93882,

     

    To filter the second child gallery using the parent gallery with dataverse tables, you need to specify the fields that contain the relationship between the parent and child tables. These fields are usually the primary key of the parent table and a foreign key of the child table.

    To determine the correct fields to use, you need to first identify the primary key of the parent table. This is typically an automatically generated unique identifier for each record in the parent table.

    Once you have identified the primary key, you can then identify the foreign key in the child table that corresponds to it. The foreign key is the field in the child table that links each child record to a specific parent record.

    With these two fields identified, you can now set up the filter for the second child gallery as follows:

    Filter('child table', field_from_child_table = galleryParent.selected.field_from_parent_table)

    Where 'field_from_child_table' is the foreign key in the child table and 'field_from_parent_table' is the primary key in the parent table.

  • dj93882 Profile Picture
    16 on at

    When I created the 1-many relationship between the parent and child table I did not specify which fields to use. I simply just defined the relationship. When I enter a child record I'm given a drop down list which happens to use the primary key of the parent record which I left as the default 'name' field. 

     

    Using Muhanned's response I looked for what was the primary key in the parent record and what is the foreign key in the child record. 

     

    In the parent table the primary key is listed as the unique identifier. This field is different from the primary field which defaults to 'name'. 

     

    In the child table there is no field in the child table to specify as the foreign key. Instead it looks like it is necessary to specify the primary identifier in the parent table. 

     

    So the filter statement for the child gallery looks like this: 

     

    Filter('child table name', ThisRecord.'parent table name'.'unique_identifier_in parent_table' = galleryBusinesses.Selected.'unique_identifier_in_parent_table')

     

    I don't know which field to specify as the foreign key in the child record to use in the filter statement. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard