cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
roli_
Frequent Visitor

Show all records related to parent table, with filter on the parent

This is probably a common scenario and I have tried to search for answer, but probably using wrong terminology.

 

I have parent and child tables where child have foreign key pointing to parent's primary key.

 

But how can I show all child records based on a filter on the parent?

 

Guess there are at least two ways to do this and I would like to see both

1. I already have a collection of the parent items filtered the way I'd like. How can I create a collection of the child records, filtered by the ones in the parent collection?

2. How can I create this in one query (collection) in case I don't need the parent collection and avoid overhead?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Community Champion
Community Champion

Hi @roli_

Use the in operator, something like:

Filter(ChildTable, ForeignKey in ParentItemCollection.Id)

Please note that the in operator is not delegated for any data source when used for membership test (the delegation table is incorrect in this regard)

 

PS Using a collection is not a bad idea from a performance point of view

View solution in original post

3 REPLIES 3
Meneghino
Community Champion
Community Champion

Hi @roli_

Use the in operator, something like:

Filter(ChildTable, ForeignKey in ParentItemCollection.Id)

Please note that the in operator is not delegated for any data source when used for membership test (the delegation table is incorrect in this regard)

 

PS Using a collection is not a bad idea from a performance point of view

View solution in original post

roli_
Frequent Visitor

Of course! Same as SQL. How could I forget. I was thinking way to complex!  Thanks!

Meneghino
Community Champion
Community Champion

You are welcome, please see my blog for PowerApps and Azure SQL Database info:

https://baizini-it.com/blog/

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (78,885)