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.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,902)