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

Join two collections and keep rows in one collection if duplicated

I have created two collections 1 and 2. Collection 1 has some people and scores which are all initialized with 0's. Collection 2 has some people and scores which are already well evaluated. So now I would like to join these two collections and keep values from Collection 2 if there are duplicate people. However, I tried so many ways and did not get good solution on it. Could anyone show some clues about it?

 

karolyuan_0-1656573740706.png

 

karolyuan_3-1656574059971.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@karolyuan 

Collect(Collection3,Collection2,Filter(Collection1, !(ID in Collection2.ID))

View solution in original post

7 REPLIES 7
phipps0218
Super User
Super User

Hi this post is very similar to this, please take a look: https://powerusers.microsoft.com/t5/Building-Power-Apps/Join-two-collections/td-p/395929

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
Subscribe to my YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg

EdViegas
Super User
Super User

Try

ClearCollect(
    ColMerge,
    Col1,
    Col2
)
Drrickryp
Super User
Super User

@karolyuan 

Collect(Collection3,Collection2,Filter(Collection1, !(ID in Collection2.ID))

I have tried this solution, but it turns out everyone's score will be updated to the same. It doesn't update with the proper person.

karolyuan_0-1656575935489.png

 

This cannot remove duplicate people from collection 1.

Use Distinct Function on your collection.

Awesome! Thank you so much for your quick and clean answer.😺

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,284)