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 / How to remove duplicat...
Power Apps
Answered

How to remove duplicates from two different collections?

(0) ShareShare
ReportReport
Posted on by 30

I'm really racking my brain on how to figure this out. I have a few collections that retrieve teams meeting data from. The one collection stores the attendees to the meetings and displays this information within a gallery. When someone selects one of the attendees it sends the info to a SharePoint folder. I then have a sign-out page with a gallery that shows the "signed in users" and updates the SharePoint with the information. My problem is I have no way to remove the attendees from the collection after they have signed in. I need to iterate through the name column of both collections and if a match is found only remove it from the attendee collection as that's the one that's displaying the data

 

Any help is greatly appreciate thank you!

Categories:
  • Michael E. Gernaey Profile Picture
    53,980 Super User 2026 Season 2 on at

    Hello Immcrac2004,

     

    I am a tiny bit confused as I don't really see an explanation for what collection 2 has in it or how they get updated or when, so I am going to do a little guess work.

     

    Do they select a user, then click a button that signs them out?? Or is there a sign out button on each gallery row?? it really helps determine how to tell how to do what you want.

     

    Collection SignedIn is driving Gallery_B (signed in users)

    If someone selected a row in Gallery_B, you want to remove arow from another collection that has a matching value in the currently selected you have 2 ways)

     

    Collection SignedOut is collection 2

     

    Scenario 1

    * You have a button on each row of Gallery_B that says sign out

    In that buttons on Select:

    1) Now to get rid of it from the other collection you would say  RemoveIf(SignedOut, NameColumn = ThisItem.NameColumn)

    2) to remove it from itself do Remove(SignedIn, ThisItem) as its the selected row you want gone.  

     

    Scenario 2

    You have a button OUTSIDE of the gallery and you press it after someone selects a row in Gallery_B

    1. RemoveIf(SignedOut, NameColumn = Gallery_B.Selected.NameColumn)

    2. Remove(SignedIn, Gallery_B.Selected)

     

     

    Please let me know if I misunderstood and please select it as an answer if it helps you

  • lmmcrac2004 Profile Picture
    30 on at

    Hello Mike yes sorry I can see how my explanation can be confusing. The first collection displays on a gallery, this gallery is for users to sign in. Once they select their name on the gallery and press submit a sharepoint page is updated with their information alongside a status saying "Signed in". There is a separate signout page that has a gallery which filters the data from the sharepoint list to show "Signed In" Users only. After selecting on the user and pressing sign out the sharepoint list is updated and their status becomes "Signed out". My goal is for when users "Sign In" I want their name to be removed from the collection so they can't press it again as they're already "Signed In" . I tried making the Sign Out list a collection as well and iterating through both lists to remove repeats but that has been challenging to accomplish. I will see if your solution helps me out

  • lmmcrac2004 Profile Picture
    30 on at

    Currently Im trying to use this: 

    lmmcrac2004_0-1694175869501.png

    It somewhat works but as soon as more than one user is added to the signout it breaks 

  • vaubeee Profile Picture
    533 on at

    If the Submit button is present in all gallery items: OnSelect of the button add code Remove(*NameOfDataSource*, ThisItem)

    If the Submit button is outside the gallery: OnSelect add Remove(*NameOfDataSource*, *NameOfGallery*.Selected)

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • lmmcrac2004 Profile Picture
    30 on at

    I have tried using this before the problem is the collection for the sign in gallery is getting teams meeting data meaning I need it to refresh constantly. I have a landing page with two buttons that say sign in and sign out, all the collections are formed when the user presses sign in to make sure updated info is gotten. So if i take that approach it will remove it but as soon as the collection is rebuilt it comes back 

  • lmmcrac2004 Profile Picture
    30 on at

    lmmcrac2004_0-1694177040970.png

    lmmcrac2004_1-1694177048538.png

    Then After Signing In this is what you see on the sign out page:

    lmmcrac2004_3-1694177107957.png

     

  • vaubeee Profile Picture
    533 on at

    Tricky 😉
    Maybe you have to separate the invited attendees (= realtime Teams data) from the users who have actually "Signed in" from your app.

    Keep the functionality to update to "Signed in" (in "real time" collection) onSelect of SignIn-Button

    Add another datasource/collection and separately store attendees who sign in there.

    Use this new collection as reference for your sign out gallery

    Remove them from the new collection, when they sign out and update their status to Signed Out (in "real time" collection)

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • uwenagel Profile Picture
    382 on at

    You can always recalculate your collection after you remove one of the elements.

     

    If you have an attribute say 'SignedIn' that can have 'Yes' or 'No' then you would show in your first collection only the ones that have 'SignedIn' = 'No'.

     

    Then when you select one entry in order to sign in you set the attribute to 'Yes' and recollect your collection.

     

    The second gallery only shows the ones from a second collection filtered with 'SignedIn' = 'Yes'. So you have to recalculate this collection as well upon signing out from the first gallery.

     

    You have to again recalculate both collections when you sign out one of the entries from the second gallery (set 'SignedIn' to 'No' again).

     

    The problem still is, how to trigger a recalculation of the galleries when an entry is made from another action (real time).

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • lmmcrac2004 Profile Picture
    30 on at

    Yeah I like this idea just the implementation seems hard like realistically I want to just be able to compare the SignIn gallery to the signout gallery and filter it that way but no matter what I do that isn't working. I think its because the signin gallery is based off a collection where the signout is based off a sharepoint list. Regardless, i feel very defeated lol 

  • Michael E. Gernaey Profile Picture
    53,980 Super User 2026 Season 2 on at

    There is no compare of 2 galleries. What would it compare?

     

    You have to provide to glue in between since you are the one defining the incoming Items values.

     

    And in your case you are saying its based on a SharePoint list, but you cannot remove an item from a Gallery that is based on a list unless you modify the list to no longer have that.

     

    What you want isn't hard, but your looking for an easy button, I couldn't easy button it any better in C/C++ or C# directly.

     

    You can use the AllItems property to validate if things exist in each, but you said remove them, thats a different story.

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard