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 / Removing Duplicate row...
Power Apps
Answered

Removing Duplicate rows in collections

(0) ShareShare
ReportReport
Posted on by 214

I am building a sales app to streamline info for my sales team next year. 

 

I am creating a combo-box that will create a drop down if a name is being entered that is matching someone that we already have in our system. I am doing this to reduce the chance of duplicate referral entries under misspelled names and are connected to the right customer profile. 

 

For example: DC Bike Shop || DD Bike Shop || DC Bik Shop || etc. 

 

To do this I have created a collections that combines our opportunity que (sales pipeline) and our Client Database

 

Collection 1 - colTMDBNames - Data from our Client Database

 

Collection 2 - colOppQueNames - Data from our sales pipeline

 

Collection3 - colTotalNames -  Combines colTMDBNames & colOppQueNames

 

Issue 

The issue that I am having is that I am getting duplicates because a few (not all) of the customers that are in the sales que, are also in the TM Database. This makes sense, since naturally all the new clients are going through this pipeline. 

 

I am wondering if there is a way to filter Collection #2 to only pull in values that meet certain status values, and / or remove duplicate values in collection #3. 

 

Code

OnSelect Property of Entry form button. 

Collect(colTMDBnames,ShowColumns('TM Client database', "Title","ClientNAME"));
Collect(colOppQueNames,ShowColumns('Opportunity Que', "Title", "Clientname"));
ClearCollect(colTotalNames,colTMDBnames,colOppQueNames);
Set(SortDescending1,Descending)

 

mcnemare1_0-1672248309165.png

 

 

 

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    Hi @mcnemare1 ,

    Try this as the total exercise

    With(
     {
     wTM:
     ShowColumns(
     'TM Client database', 
     "Title",
     "ClientNAME"
     ),
     wOpp:
     ShowColumns(
     'Opportunity Que', 
     "Title", 
     "Clientname"
     )
     },
     ClearCollect(
     colTotalNames,
     wTM,
     Filter(
     wOpp,
     !(ClientName in wTM.CLIENTNAME)
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • mcnemare1 Profile Picture
    214 on at

    Hey @WarrenBelz 

     

    Thanks for the reply. 

     

    the formula doesn't seem to like "ClientName in wTM.CLIENTNAME" (see below)

    Thoughts?

     

    mcnemare1_0-1672346302768.png

     

  • Verified answer
    mcnemare1 Profile Picture
    214 on at

    @WarrenBelz 

     

    NVM I figured it out  just a misspelling of ClientName and ClientNAME

    With(
     {
     wTM:
     ShowColumns(
     'TM Client database', 
     "Title",
     "ClientNAME"
     ),
     wOpp:
     ShowColumns(
     'Opportunity Que', 
     "Title", 
     "Clientname"
     )
     },
     ClearCollect(
     colTotalNames,
     wTM,
     Filter(
     wOpp,
     !(Clientname in wTM.ClientNAME)
     )
     )
    );

     

     

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard