cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rg129
Frequent Visitor

Compare collections to find duplicates

Hi I hope someone can help. I have 3 collections in a gallery. Each collection has a name field and date field. How do I compare the three collections to see if there are duplicate values?

If there are duplicates I want to let the user know that there are dupes.

Collection A - name = Bob

                         Date = 6/15/2022

 

Collection B - name = Amy

                         Date = 7/8/2022

 

Collection C - name = Bob

                         Date = 6/15/2022

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Rg129 ,

You have three comparisons there - A-B, B-C and A-C - example of the first one

With(
   {
      wDup: 
      ForAll(
         CollectionA As aDup,
         Filter(
            CollectionB,
            name = aDup.name && Date = aDup.Date
         )
      )
   },
   If(
      CountRows(wDup) > 0,
      Notify("Duplicated")
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

3 REPLIES 3
theapurva
Super User
Super User

you can refer the solution given by @v-jefferni  here:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Display-Duplicate-Items-in-Gallery/td-p/6975...

-----------------------------------------------------------------------------------
Liked My Solution? Click on the Thumbs Up below.
Did I answer your Question? Please Click Accept as Solution below

Want to Support me? Buy Me A Coffee
WarrenBelz
Super User
Super User

Hi @Rg129 ,

You have three comparisons there - A-B, B-C and A-C - example of the first one

With(
   {
      wDup: 
      ForAll(
         CollectionA As aDup,
         Filter(
            CollectionB,
            name = aDup.name && Date = aDup.Date
         )
      )
   },
   If(
      CountRows(wDup) > 0,
      Notify("Duplicated")
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Thank you so much! You made it simple. 

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.

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 (4,392)