cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sivaprasad21
Frequent Visitor

How to collected records from a nested collection

I have a nested collection table named chklist.  The chklist table contain a nested table checklist which has two fields. Id and value. The value is again a table which has two fields ischecked, title.

 

1. Table1- checklist(table)

2.checklist:

Id, value(table) 

3. value:

isChecked, title 

 

Please advice how to collect all records( isChecked, title) into a single collection table.

 

Thank you

 

 

 

 

 

 

 

 

3 REPLIES 3
CNT
Community Champion
Community Champion

@Sivaprasad21 Try this,

ForAll(chklist As Collection1
	ForAll(Collection1.checklist As Collection2
		ForAll(Collection2.value As Collection3
			Collect(CombinedCollection, Collection2.Id, Collection3.isChecked, Collection3.title)
		)
	)
)
RandyHayes
Super User III
Super User III

@Sivaprasad21 

Please consider the following formula:

ShowColumns(
    Ungroup(
        Ungroup(chklist, "checklist"),
        "value"
    ),
    "Id", "title"
)

This will return a table of all of the Id and title records in your nested table.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi Randy,

 

Thanks for the hint. I tried the below and able to get the value table into the chklist_value.

 

Clear(chklist_value);
Collect(
    chklist_value,
    ShowColumns(
        Ungroup(
            chklist,
            "checklist"
        ),
        "value"
    )
)

 But I cant go deep further into accessing the values inside value table to fetch the fields isChecked and title.Please find below the code used.

 

Clear(chklist_value);
Collect(
chklist_value,
ShowColumns(
Ungroup(
Ungroup(chklist, "checklist"),
"value"
),
"isChecked", "title"
)
);

 

The above code says Showcolumn has invalid arguments. Please refer to the screen shots of table structure.

value.PNG

 

 

 The is the final structure

value_title.PNG

Thanks

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,416)