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!
Solved! Go to Solution.
Hi @Anonymous
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
Hi @Anonymous
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
Of course! Same as SQL. How could I forget. I was thinking way to complex! Thanks!
You are welcome, please see my blog for PowerApps and Azure SQL Database info:
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
178 | |
94 | |
63 | |
61 | |
58 |
User | Count |
---|---|
246 | |
165 | |
91 | |
76 | |
76 |