cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Buddy2019
Level: Powered On

Forall on nested collection

Using a forall() , I want to store all the MeetingA values  inside a new collection. I tried the following but it doesn't work. How could I get all the meetingA values ?

 

ClearCollect(NewOrder, ForAll(CollectTest, {newTime:Meeting.Value.MeetingA}))

 

 

 

ClearCollect(
    CollectTest,
    {
        Id: 1,
        Meeting: [
            {
                MeetingA: "MeetingA1",
                B: "MeetingB1"
            },
            {
                MeetingA: "MeetingA2",
                B: "MeetingB2"
            }
        ]
    },
    {
        Id: 2,
        Meeting: [
            {
                MeetingA: "MeetingC",
                B: "MeetingD"
            }
        ]
    },
    {
        Id: 3,
        Meeting: [
            {
                MeetingA: "MeetingE",
                B: "MeetingF"
            }
        ]
    }
)

 

 

Thanks !

1 REPLY 1
Super User
Super User

Re: Forall on nested collection

@Buddy2019 

There are two layers of tables in the collection you provided so a nested FORALL loop is necessary to get at the MeetingA values.

 

Here's my code:

 

ForAll(
    CollectTest,
    ForAll(Meeting.Value,
        Collect(colMeetingA,{newTime:Value.MeetingA})
    )
);

 

The resulting Collection is:

 

"MeetingA1",
"MeetingA2",
"MeetingC",
"MeetingE"

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,417)