web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter collection base...
Power Apps
Answered

Filter collection based on presence of similar item in another collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @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."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Both lists/collections have a lots of same columns 

  • v-monli-msft Profile Picture
    Microsoft Employee on at

    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

     

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard