
Announcements
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.
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.