Announcements
Hi All
I have 2 collections from 2 SP lists with same columns and I need Collection1 to have only items that are not present in Collection2.
Anybody knows how this can be done?
Thanks
@Anonymous
You must loop through Collection1 using FORALL to check if each record exists in Collection2 with the help of the LOOKUP functon. My assumptions are Collection1 initially has all of the records stored within it and we are seeking to remove any duplicates. I also assume your collection has only a single column called your_column.
ClearCollect( Collection1, ForAll( Collection1, If( IsBlank(LookUp(Collection2, your_column_2, Collection1[your_column_1])), {your_column_1: your_column_1} ) ) )
---Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Both lists/collections have a lots of same columns
Hi @Anonymous ,
In addition to what @mdevaney has suggested, if your collections' columns are more than 1, please first use below formula to create a new collection with only one column:
ClearCollect(Collection3,Distinct(Collection2, NEWCOLUMN))
Then use this Collection3 to loop through Collection1.
Regards,
Mona
Thanks for your suggestions guys, but I think I found better way to do it:
ForAll(Collection1, If( Column1 > 0 , RemoveIf(Collection2, Column1=Collection1[@Column1]) ) );
Let me know what you think
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 551
WarrenBelz 430 Most Valuable Professional
Valantis 298