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 / Remove duplicate email...
Power Automate
Unanswered

Remove duplicate emails from inbox?

(0) ShareShare
ReportReport
Posted on by 271

I have a problem I though Power Automate would be perfect for, but I can find any existing Flow solutions for it.

 

I receive many dozens of duplicate emails a day in my Outlook inbox as a result of being included on more than one distro list, and/or part of a "redirect" rule. This obviously clogs up my inbox and causes all kinds of headaches. Since I can't really control which distro lists or redirect rules I'm placed on, I was hoping there was a way to have a rule that when an email arrives, it checks my inbox and if that email already exists, it deletes the new one (or sends it to a subfolder, etc.).

 

Is this even theoretically possible with PA?

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @MarcusD1 

    Please see my example below and let me know if this is what you need.  Please note the single quotes in my search filter.

    image.png

  • Barret Profile Picture
    652 Most Valuable Professional on at

    You could definitely come up with something that could accomplish this. The tricky part would be creating the logic that determines what defines an email as a duplicate. You can do something like:

     

    When a new email arrives, compare against the last 50 emails or something and if the subject and first 50 characters of the body match any of those emails, delete it or move it to subfolder.

     

    You won't be able to compare the from or to addresses if some of them are to distros or forwarded from another account. And you'll have to strip things like FWD or something like that from subject lines for forwarded emails and so forth. But it definitely could be done.

  • MarcusD1 Profile Picture
    271 on at

    I implemented this and let it run over the weekend. It's failing in the Conditional. Doesn't like the logic expression.

     

    MarcusD1_0-1637601817961.png

     

    This is the expression I have in the Condition:

    length(outputs('Get_emails_(V3)')?['body'])

    MarcusD1_1-1637601937313.png

     

    Did I typo something?

     

  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @MarcusD1 

    Your expression should reference body/value rather than body.  You should have selected Value rather than Body from Dynamic properties.

    image.png

  • MarcusD1 Profile Picture
    271 on at

    I fixed the expression, but now it's applying it to every email. My "If yes" action was set to move the duplicate into a sub-folder (or at least that was my intention), but since making the edit to the expression, every email is being moved into the sub-folder. Unfortunately, given the week, I haven't received any duplicates yet since making the correction - so I'm not sure yet how those are behaving.

  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @MarcusD1 

    First, turn off your Flow so that it doesn't do any damage or cause you work.

    Then, please post a screen shot of the Flow.

     

     

  • MarcusD1 Profile Picture
    271 on at

    Yeah... I've certainly done that before (caused damage and/or created a lot of clean up for myself). 😁 But minimal impact so far this time.

     

    Here's my screen shots:

    MarcusD1_3-1637616611436.png

     

    MarcusD1_2-1637616533754.png

    The full text of the expression is: 

    length(outputs('Get_emails_(V3)')?['body/value'])

     

    MarcusD1_1-1637616476146.png

     

    ... and thank you for your continued help with this Scott. I just signed up for a "How to Use Flow Expressions" course on Udemy, but I'm not there yet.

  • jowe1989 Profile Picture
    2 on at

    Hi Scott

    I tried it too and it is like Marcus said. It always delete all mails and not just the duplicated ones. I didnt found any solution to handle it.

    Best regards

  • dororeich Profile Picture
    3 on at

    Have you solved your issue already? I am looking for a similar flow that deletes my duplicate emails

  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    I suggest using the built-in Outlook Clean Up function.  On the Home ribbon, click on Clean-up and select Folder or Folder and Subfolders.

    image.png

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