cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nchandran
Helper V
Helper V

Merge two collections into one

I'm not able to consolidate two collections into one.

first i have one collection ColConsumMain that collects the main gallery of user data from sharepoint list A

second collection ColConsumDetails collects the sub gallery of withdraw data from sharepoint list B and main gallery pulls data from master ID column in this source. I wrote the third collection ColConsumAll but its showing all headers instead of data. Syntax below. Screenshot of collections and syntax.

ClearCollect(ColConsumMain,ShowColumns(GalleryCRWelderInfo.AllItems,"Name","Date","Transaction","Shift","DayNight","ID"));ClearCollect(ColConsumDetails,ShowColumns(ConsumableWithdraw,"OrderNo","NCRNo","Description","OpsNo","WorkCentre","Batch","HeatNo","Mass","Qty","Dia","Brand","PartNo","Balance","MasterID"));ClearCollect(ColConsumAll,AddColumns(ColConsumMain,"OrderNo","NCRNo","Description","OpsNo","WorkCentre","Batch","HeatNo","Mass","Qty","Dia","Brand","PartNo","Balance",Filter(ColConsumDetails,MasterID=ID).Balance))

 

ColConsumMain.jpgColConsumdetails.jpgtotal collect error.jpg

 

 

 
 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @nchandran ,

 

You have a misunderstanding of the parameters of the addclumns() function.Please refer to the picture.

v-xiaochen-msft_0-1616999697403.png

 

So, your formula should be modified to look like the following:

ClearCollect(ColConsumAll,AddColumns(ColConsumMain,"OrderNo",Filter(ColConsumDetails,MasterID=ID).OrderNo,"NCRNo",Filter(ColConsumDetails,MasterID=ID).NCRNo,"Description",Filter(ColConsumDetails,MasterID=ID).Description,"OpsNo",Filter(ColConsumDetails,MasterID=ID).OpsNo,"WorkCentre",Filter(ColConsumDetails,MasterID=ID).WorkCentre,"Batch",Filter(ColConsumDetails,MasterID=ID).Batch,"HeatNo",Filter(ColConsumDetails,MasterID=ID).HeatNo,"Mass",Filter(ColConsumDetails,MasterID=ID).Mass,"Qty",Filter(ColConsumDetails,MasterID=ID).Qty,"Dia",Filter(ColConsumDetails,MasterID=ID).Dia,"Brand",Filter(ColConsumDetails,MasterID=ID).Brand,"PartNo",Filter(ColConsumDetails,MasterID=ID).PartNo,"Balance",Filter(ColConsumDetails,MasterID=ID).Balance))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

Hi @nchandran ,

 

You have a misunderstanding of the parameters of the addclumns() function.Please refer to the picture.

v-xiaochen-msft_0-1616999697403.png

 

So, your formula should be modified to look like the following:

ClearCollect(ColConsumAll,AddColumns(ColConsumMain,"OrderNo",Filter(ColConsumDetails,MasterID=ID).OrderNo,"NCRNo",Filter(ColConsumDetails,MasterID=ID).NCRNo,"Description",Filter(ColConsumDetails,MasterID=ID).Description,"OpsNo",Filter(ColConsumDetails,MasterID=ID).OpsNo,"WorkCentre",Filter(ColConsumDetails,MasterID=ID).WorkCentre,"Batch",Filter(ColConsumDetails,MasterID=ID).Batch,"HeatNo",Filter(ColConsumDetails,MasterID=ID).HeatNo,"Mass",Filter(ColConsumDetails,MasterID=ID).Mass,"Qty",Filter(ColConsumDetails,MasterID=ID).Qty,"Dia",Filter(ColConsumDetails,MasterID=ID).Dia,"Brand",Filter(ColConsumDetails,MasterID=ID).Brand,"PartNo",Filter(ColConsumDetails,MasterID=ID).PartNo,"Balance",Filter(ColConsumDetails,MasterID=ID).Balance))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,258)