cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Understanding Nested Collections

Hello,
I am having a hard time trying to understand how nested collections work in PowerApps. I have a very nested collection and want to extract information and display it in the gallery. I looked around on the internet but I only found basic examples of how to extract data.

 

This is how my collection looks like:

ClearCollect(NestedListExample, {List01:{List01A: {List01AA: {List01AAA:{List01AAAA: "Book_ID01"}}, List01C: "Random"}, List01B: "ABC"}, List02: "Random info", List03: "Random info"}, {List01:{List01A: {List01AA: {List01AAA:{List01AAAA: "Book_ID02"}}, List01C: "Random"}, List01B: "ABC"}, List02: "Random info", List03: "Random info"},{List01:{List01A: {List01AA: {List01AAA:{List01AAAA: "Book_ID03"}}, List01C: "Random"}, List01B: "RRR"}, List02: "Random info", List03: "Random info"},{List01:{List01A: {List01AA: {List01AAA:{List01AAAA: "Book_ID04"}}, List01C: "Random"}, List01B: "ABC"}, List02: "Random info", List03: "Random info"})

level01level01level02level02level03level03level04level04

level5level5

 

If this makes sense,  I want to display all the List01AAA items IF List01B== “ABC” in a gallery. 

 

Any examples on how to extract information at different levels from nested collections would be helpful :). 

 

Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Understanding Nested Collections

Hi @VP200 ,

Do you want to display all the List01AAA items in a Gallery when the List01B== “ABC”?

 

I have made a test on my side, please take a try with the following workaround:1.JPG

Add a Gallery control within your app, set the Items property to following formula:

ForAll(
       Filter(NestedListExample, List01.List01B = "ABC"),
       List01.List01A.List01AA.List01AAA
)

Add a Label control within above Gallery, set the Text property to following:

ThisItem.List01AAAA

Please consider take a try with above solution, check if the issue is solved.

 

More details about the ForAll function, please check the following article:

ForAll function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User
Dual Super User

Re: Understanding Nested Collections

Hi @VP200 

 

Not sure why this complex nested structure

 

but try this on button click or something

 

ClearCollect(colNested2, Filter(NestedListExample.List01,List01.List01B ="ABC"));ClearCollect(colNestedFinal,ForAll(colNested2.List01,List01.List01A.List01AA.List01AAA))

 

This will give you colNestedFinal which you can use in Gallery

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

Highlighted
Community Support
Community Support

Re: Understanding Nested Collections

Hi @VP200 ,

Do you want to display all the List01AAA items in a Gallery when the List01B== “ABC”?

 

I have made a test on my side, please take a try with the following workaround:1.JPG

Add a Gallery control within your app, set the Items property to following formula:

ForAll(
       Filter(NestedListExample, List01.List01B = "ABC"),
       List01.List01A.List01AA.List01AAA
)

Add a Label control within above Gallery, set the Text property to following:

ThisItem.List01AAAA

Please consider take a try with above solution, check if the issue is solved.

 

More details about the ForAll function, please check the following article:

ForAll function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,471)