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

How to remove duplicates but keep item that was just created/modified?

(0) ShareShare
ReportReport
Posted on by 26

I have an attendance sheet that is set up like this:

jakefromstfarm_0-1712260938679.png

This feeds into a Power BI visualization where the visualization breaks out the dates between start and end dates. I also have a flow that can break up the dates between the start and end dates as well, but have them turned off at the moment.

 

The flow I'm having trouble creating should check if the item that's being created or modified matches the start date and name of something already in the list. If it matches, it will delete the old instance (duplicate).

I want to do this since people make mistakes inputting their attendance and can influence the data in the Power BI visualization. Is there a way to do this in Power Automate? Modified and Modified by are metadata columns.

Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi there, 

     

    So what you'll want to do is on Creation / Modification (trigger), use a "Get Items", and a Filter Query of Title eq 'XXXX' and Start Date eq 'XXXXX'  [ where the XXXX is dynamic content from your trigger pointing to the same piece of data.]

     

    Then you can use a Condition. The condition will be length()  where inside of the () you'll point to the body output from your Get Items. If the length is 0, then no duplicate found. If the length is NOT 0, then you'll have found a duplicate and can delete it.

  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @jakefromstfarm ,

    @Rhiassuring One of his logical mistakes is that he would delete the newly created item and the original item at the same time.

    I recommend that you add 'Title' equals 'Title' and 'Start Date' equals 'Start Date', and then add that the created time of the item that meets these two conditions is less than the created time of the new item, so as to avoid the situation that the newly created item and the original item are deleted at the same time.

    I did a test for your reference.

    In my scenario:

    vyetonggumsft_1-1712298103320.png

    vyetonggumsft_2-1712298381203.png

    vyetonggumsft_3-1712298475282.png

    Best Regards,

    Sunshine Gu

  • Chriddle Profile Picture
    8,674 Super User 2026 Season 1 on at

    Don't iterate all items. First, filter for items you want to delete.

  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Chriddle ,

    I know what you mean, thank you for the reminde.

    However, in order to avoid using the internal name of Start Date in OData Filter, so that users do not need to look at the internal column names.

    Best Regards,

    Sunshine Gu

  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @jakefromstfarm ,

    Below I followed @Chriddle  reminder to modify the flow:

    My SharePoint List:

    vyetonggumsft_3-1712310632536.png

    In Filter Query, we need to use the internal name of the column to filter.

    When there are special characters such as spaces, '_', '/' and other special characters in the column name, the display name will be different from the internal name, then we need to jump to the edit interface of the list to view the internal name of the column.

    Here are the steps to see the internal name of the start date.

    vyetonggumsft_4-1712310668277.png

    vyetonggumsft_5-1712311229890.png

    vyetonggumsft_6-1712311402620.pngMy Flow:

    vyetonggumsft_7-1712311509087.png

     

    Title eq '@{triggerOutputs()?['body/Title']}' and internalname eq '@{triggerOutputs()?['body/internalname']}' and Created lt '@{triggerOutputs()?['body/Created']}'

     

    Best Regards,

    Sunshine Gu

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 636

#2
Valantis Profile Picture

Valantis 372

#3
11manish Profile Picture

11manish 335

Last 30 days Overall leaderboard