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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Remove item from colle...
Power Apps
Unanswered

Remove item from collection by comparing with another collection

(0) ShareShare
ReportReport
Posted on by 33

Hallo,

 

I am trying to remove items by comparing two collections. If a value is found in the one collection, it should be removed in the second collection. Here is what I have tried: 

 

ForAll(collection1,RemoveIf(collection2,Titel=ThisRecord.Titel));

 

But this isn't working. I assume that with ThisRecord, I refer to current collection1 item in the forall loop. Somehow it deletes items in collection2 that are not even in collection1.

 

Do I miss something?

Categories:
I have the same question (0)
  • Verified answer
    Prabhakar_S Profile Picture
    735 Moderator on at

    Hi @benji-7 ,

     

    Try this,

     

    ForAll(
    collection1,
    RemoveIf(
    collection2,
    Titel = Value.Titel
    )
    )

     

    Thanks!!!

     

    Please consider marking my response as the accepted solution if it successfully resolves your concern. If you found the information beneficial in other aspects, kindly express your appreciation by giving it a thumbs-up.

     

  • benji-7 Profile Picture
    33 on at

    That gives me an error: "invalid use of '.' " and "Value isn't recognized"

     

    I also tired this one:

    ForAll(collection1,Remove(collection2,LookUp(collection2,Title=ThisRecord.Title)));

     

    but same result. 

  • Verified answer
    benji-7 Profile Picture
    33 on at

    I found the solution:

    ForAll(collection1 as col1,Remove(collection2,LookUp(collection2,col1.Title=ThisRecord.Title)));

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard