cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Parent Child Collections

Is it possible to create two collections whereby there is a parent child relationship, the data needs to loaded into the app as live connection cannot always be guaranteed.

 

So I have collection of parent (colParentItems) items already filtered on load to be valid, what I want is an additional collection of all child (colChildItems) items from SharePoint where the child parent.id is in the colParentItems.

 

Sounds like a simple query, but it's beating me.. Tried following..

ForAll(colParentItems, Collect(colChildItems, Filter(SharePointList, Parent.Id = colParentItems[@ID])))

and

Filter(SharePointList, Parent.Id in colParentIems[@ID])

but neither is working for me, so am stumped..

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

@MrNappa,

Many thanks for coming back with a suggestion..

I tweaked mine again back to this and it seems to get all the items I want..  whereas previously it was only returning afew items..

 

ForAll(colParentItems,Collect(colChildItems,Filter(SharePointList,Parent.Id=colParentItems[@ID])));

View solution in original post

2 REPLIES 2
Advocate V
Advocate V

I'm not certain, but the top solution might not be working correctly because the inner filter is meddling with the scope of your collections/data sources.

 

You could try:

ForAll(colParentItems, Collect(colChildItems, Filter([@SharePointList], Parent.Id = ID)))

Documentation about scoping.

Anonymous
Not applicable

@MrNappa,

Many thanks for coming back with a suggestion..

I tweaked mine again back to this and it seems to get all the items I want..  whereas previously it was only returning afew items..

 

ForAll(colParentItems,Collect(colChildItems,Filter(SharePointList,Parent.Id=colParentItems[@ID])));

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Top Solution Authors
Top Kudoed Authors
Users online (9,313)