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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Overwriting Data/Removing Duplicate Entries

(0) ShareShare
ReportReport
Posted on by 6

Hi! I need to build a flow that will automatically delete or overwrite duplicate rows when it identifies a duplicate ID in a SharePoint list. The list I am using is an existing list that data is added to every few weeks. Typically, the rows added are unique, but occasionally a row contains an ID previously used. I need a flow that will look at my list when new rows are added, identify any duplicates, and overwrite previous rows (or delete previous rows) and replace with the newest row added. Is this possible?

I have the same question (0)
  • ScottShearer Profile Picture
    25,240 Most Valuable Professional on at
    Re: Overwriting Data/Removing Duplicate Entries

    @acoghlan 

    I have a Flow that I can post for you but it would be a better idea to just make the ID column that you're using unique (no duplicates).  That way, users cannot enter duplicate data.

    Let me know if that works for you.

     

  • acoghlan Profile Picture
    6 on at
    Re: Overwriting Data/Removing Duplicate Entries

    Thanks, Scott. Unfortunately making the ID column unique won't work because we want to use the newest entry added. If I set the ID column to unique, I won't be able to use the newest information, only the original row information corresponding with ID. I need some way to overwrite old information or identify duplicate IDs and keep only the row with the most recent information.

  • ScottShearer Profile Picture
    25,240 Most Valuable Professional on at
    Re: Overwriting Data/Removing Duplicate Entries

    @acoghlan 

    I'll post a sample flow shortly

  • ScottShearer Profile Picture
    25,240 Most Valuable Professional on at
    Re: Overwriting Data/Removing Duplicate Entries

    @acoghlan 

    Take a look at the screen shots below and let me know if you have and issues.  Substitute the internal name of your ID column for myID in the query filter.

    image.pngimage.pngimage.png

  • acoghlan Profile Picture
    6 on at
    Re: Overwriting Data/Removing Duplicate Entries

    Thank you for your help! I'm having trouble with the "Get items" part, my formula seems to have a break, I'm thinking it's with the Filter Query. Any ideas?

    acoghlan_0-1701301158861.png

     

  • ScottShearer Profile Picture
    25,240 Most Valuable Professional on at
    Re: Overwriting Data/Removing Duplicate Entries

    @acoghlan 

    You need to remove the Title reference from Dynamic properties in both locations.

    In the query filter, replace it with the word Title entered as text.  See my example above and enter Title instead of myID.

    In the Order by, enter ID as plain text in place of the Title reference.  This should be identical to my example above.

     

    Let me know if you need more help.

     

  • acoghlan Profile Picture
    6 on at
    Re: Overwriting Data/Removing Duplicate Entries

    Hi Scott, thank you for the clarification. I was able to get my flow to run but it isn't deleting the row item as it should. I tested by entering a non-unique value into the 'Title' column and I would expect the flow to recognize the duplicate value and delete the oldest row item corresponding with the duplicated 'Title' value. I attached a photo of the error below and my code. Do you see where I could be going wrong?

     

    acoghlan_0-1701365242963.png

     

    acoghlan_1-1701365488776.png

     

  • ScottShearer Profile Picture
    25,240 Most Valuable Professional on at
    Re: Overwriting Data/Removing Duplicate Entries

    @acoghlan 

    Check your Get items action - did it return any items?  If so, how many?

    If not, can I see your filter query?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard