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
MrNappa
Kudo Collector
Kudo Collector

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,314)