cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Super User
Super User

Merge Two Collections

Experts,

 

I have two collections . My page is having two button , 

 

Button A is assigned with Collection A

 

 

 

Collection A : test9 , 

 


If(CountRows(Filter(test9,orderNumber=orderNumber)) > 0 ,
ClearCollect(
test9,
{
priority: "",
state: " ",
sequence: "",
shortText: "",
orderNumber: "",
breakdownSymptomCode: "",
breakdownSymptomGroupCode: "",
customerCode: "",
equipmentCode: "",
orderDate: "",
adviceText: "",
center: "",
syncType: "",
routeId: "",
activityClass: "",
serviceType: "",
orderClass: "",
orderstatus: ""
}

)
);

 

LoadData(
test9,
"MyLocalData"

);

Merging two collections 

 

ClearCollect(mofilter,test9,test91);

 

 

---------------

 

Second Collection

 

Button B is assigned with Collection B

 

Collection B : test91

 

ClearCollect(

test91,
{
priority: "",
state: " ",
sequence: "",
shortText: "",
orderNumber: "",
breakdownSymptomCode: "",
breakdownSymptomGroupCode: "",
customerCode: "",
equipmentCode: "",
orderDate: "",
adviceText: "",
center: "",
syncType : "",
routeId: "",
activityClass: "",
serviceType: "",
orderClass: "",
orderstatus: ""
}

);

LoadData(test91,
"MyLocalData92"


);

 

Merging two collections 

ClearCollect(mofilter,test9,test91);

 

 

-------------

 

I have gallery in which following code is attached in items,

 

Filter(
mofilter ,
Dropdown3.Selected.Value = ""
Or orderClass=Dropdown3.Selected.Value Or TextInput12.Text=equipmentCode Or TextInput12_1.Text=customerCode )

 

.........

 

Working Method is First will click Button A and work further in Gallery displayed items And then click the button B and then work further. 

 

Issue here is 

 

When click button B then data is showing as split in gallery items, Actually i want all together . How to achieve this. 

 

Issue is . 

 

Below gallery shows split between 1016890 and 1002905. Both from different collections. While merging its appearing like this . 

AVTS_0-1657830238320.png

 

Expected 

 

AVTS_1-1657830327173.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@AVTS 

So, this bit of code

ClearCollect(
test9,
{
priority: "",
state: " ",
sequence: "",
shortText: "",
orderNumber: "",
breakdownSymptomCode: "",
breakdownSymptomGroupCode: "",
customerCode: "",
equipmentCode: "",
orderDate: "",
adviceText: "",
center: "",
syncType: "",
routeId: "",
activityClass: "",
serviceType: "",
orderClass: "",
orderstatus: ""
}

)

... and this bit of code

 

ClearCollect(

test91,
{
priority: "",
state: " ",
sequence: "",
shortText: "",
orderNumber: "",
breakdownSymptomCode: "",
breakdownSymptomGroupCode: "",
customerCode: "",
equipmentCode: "",
orderDate: "",
adviceText: "",
center: "",
syncType : "",
routeId: "",
activityClass: "",
serviceType: "",
orderClass: "",
orderstatus: ""
}

);

Are both creating a blank record in each collection. These are most likely the blanks that you are seeing in the output.

 

Maybe you should be adding the Clear() after creating test91, ie ??

ClearCollect(

test91,
{
priority: "",
state: " ",
sequence: "",
shortText: "",
orderNumber: "",
breakdownSymptomCode: "",
breakdownSymptomGroupCode: "",
customerCode: "",
equipmentCode: "",
orderDate: "",
adviceText: "",
center: "",
syncType : "",
routeId: "",
activityClass: "",
serviceType: "",
orderClass: "",
orderstatus: ""
}

);

// add clear here, ie
Clear(test91);

LoadData(test91,
"MyLocalData92"


);

 

 

View solution in original post

3 REPLIES 3
EddieE
Super User
Super User

@AVTS 

You are adding a blank record before you do LoadData which is what you are seeing in the output. Before you run LoadData, do this

 

Clear(test9);

Hi requirement is like this Collection A is having set of data and Collection B is having set of data which i memrging . By clear test9 then Collection A data will go  which is not the expected outcome 

@AVTS 

So, this bit of code

ClearCollect(
test9,
{
priority: "",
state: " ",
sequence: "",
shortText: "",
orderNumber: "",
breakdownSymptomCode: "",
breakdownSymptomGroupCode: "",
customerCode: "",
equipmentCode: "",
orderDate: "",
adviceText: "",
center: "",
syncType: "",
routeId: "",
activityClass: "",
serviceType: "",
orderClass: "",
orderstatus: ""
}

)

... and this bit of code

 

ClearCollect(

test91,
{
priority: "",
state: " ",
sequence: "",
shortText: "",
orderNumber: "",
breakdownSymptomCode: "",
breakdownSymptomGroupCode: "",
customerCode: "",
equipmentCode: "",
orderDate: "",
adviceText: "",
center: "",
syncType : "",
routeId: "",
activityClass: "",
serviceType: "",
orderClass: "",
orderstatus: ""
}

);

Are both creating a blank record in each collection. These are most likely the blanks that you are seeing in the output.

 

Maybe you should be adding the Clear() after creating test91, ie ??

ClearCollect(

test91,
{
priority: "",
state: " ",
sequence: "",
shortText: "",
orderNumber: "",
breakdownSymptomCode: "",
breakdownSymptomGroupCode: "",
customerCode: "",
equipmentCode: "",
orderDate: "",
adviceText: "",
center: "",
syncType : "",
routeId: "",
activityClass: "",
serviceType: "",
orderClass: "",
orderstatus: ""
}

);

// add clear here, ie
Clear(test91);

LoadData(test91,
"MyLocalData92"


);

 

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,032)