cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lliu08
Helper I
Helper I

Power Apps Collection

Hi Community,

 

I need to create a collection from three collections (so the data sources are from the three collections). 
In additional to that, I need to add another column to specify which data this record is coming from (what the original collection table was).

 

tried so many different collect statements and it’s not working, please advise. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @lliu08 ,

 

Could you please share more details about your scenario? Would you like to add a column in the collection created with data from the other 3 collections?

 

If so, could you please tell me how would you like to create the new collection? Does the new collection collect column values from that three collections and combine them into one record? Or retrieve whole records from that three collections by filtering? Could you please share some test data of the collections so we will be able to know table structure of the collections that would be helpful to resolve the problem? 

 

Generally speaking, in your case you could use AddColumns function in the three collections with column value of the collection name:

ClearCollect(col1, AddColumns(table1, “CollectionName”,”col1” ))
ClearCollect(col2, AddColumns(table2, “CollectionName”,”col2” ))
ClearCollect(col3, AddColumns(table3, “CollectionName”,”col3” ))

AddColumns function refer to:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping#syntax

 

When creating the new collection, you could see the CollectionName column in each collection, and you could use ThisRecord.CollectionName to get names of each collection.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @lliu08 ,

 

Could you please share more details about your scenario? Would you like to add a column in the collection created with data from the other 3 collections?

 

If so, could you please tell me how would you like to create the new collection? Does the new collection collect column values from that three collections and combine them into one record? Or retrieve whole records from that three collections by filtering? Could you please share some test data of the collections so we will be able to know table structure of the collections that would be helpful to resolve the problem? 

 

Generally speaking, in your case you could use AddColumns function in the three collections with column value of the collection name:

ClearCollect(col1, AddColumns(table1, “CollectionName”,”col1” ))
ClearCollect(col2, AddColumns(table2, “CollectionName”,”col2” ))
ClearCollect(col3, AddColumns(table3, “CollectionName”,”col3” ))

AddColumns function refer to:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping#syntax

 

When creating the new collection, you could see the CollectionName column in each collection, and you could use ThisRecord.CollectionName to get names of each collection.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

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.

Users online (1,352)