Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

When email arrives in deleted folder

(0) ShareShare
ReportReport
Posted on by 260

Built a Power Automate with a trigger "when a new email arrives (V3)" and selected the delelted folder.  The purpose of this flow was to detect incorrectly deleted emails and use a SharePoint "white list" of email addresses to restore them to the inbox folder.

 

I then selected an email from inbox and moved it to the deleted folder, but the flow was not triggered.

 

Does this trigger only work on email "originally arriving" versus being moved?  That would be dishearting....

 

Thanks in advance.

  • VictorIvanidze Profile Picture
    12,509 on at
    Re: When email arrives in deleted folder

    The MAPI property PR_LAST_MODIFICATION_TIME can be retrieved only using a GRAPH request.

  • lmheimendinger Profile Picture
    260 on at
    Re: When email arrives in deleted folder

    Yuck.  It doesn't appear that MAPI property is returned from Get emails (V3) Power Automate action. Received time is the only date field.  Is the PR_LAST_MODIFICATION_TIME available in GRAPH then?

     

    "To delete is not the same thing as to deliver. "  I understand, but when an email is selected and the action delete  used, it does trigger the flow.  If it is simply moved to the deleted folder, it is not triggered. I haven''t yet tested how the behavior works when a rule intercepts an incoming email and deletes it by "moving to the deleted folder."  I assume it won't trigger, as it probably just automates the move.  The user is most concerned about actual emails being deleted, however, not just moved.

     

     

  • VictorIvanidze Profile Picture
    12,509 on at
    Re: When email arrives in deleted folder

    To delete is not the same thing as to deliver.  I don't recommend you to use the "When a new email arrives (V3)" trigger with Deleted items folder.

  • lmheimendinger Profile Picture
    260 on at
    Re: When email arrives in deleted folder

    Thanks.  Here's an update as well.

     

    If an email is deleted and not just moved to the deleted folder, the flow is triggered by the delete action.  Moving does not trigger it.

  • Verified answer
    VictorIvanidze Profile Picture
    12,509 on at
    Re: When email arrives in deleted folder

    1) Each message in Outlook has the datetime stamp PR_LAST_MODIFICATION_TIME (MAPI property). It will show date and time of copying/moving to the Deleted items folder.

    2)  Look at this:   https://learn.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0&tabs=http     Visit GRAPH Explorer and play a bit.

  • lmheimendinger Profile Picture
    260 on at
    Re: When email arrives in deleted folder

    I haven't used GRAPH before, can you offer pointer?

     

    The problem with the "since last run" is not having a "date moved to deleted folder" to use.  Let me explain.  The user has reason to believe that others who have access may be accdently (or on purpose) deleting emails.  So a an email arriving Monday morning, e.g.., might be deleted on Wednesday afternoon but the email date field to use is date received.  

     

    If the flow ran say Tuesday night, the email that will be deleted is not in the folder.  When the email is deleted the next day and the flow subsequently runs, the received date would be back to Monday and out of scope from the last flow run of Tuesday.

     

    Still, if I can grab enough emails and can check them against a white list, it makes no difference when they got deleted unless it was an ancient email.

     

    thanks for your response.

  • VictorIvanidze Profile Picture
    12,509 on at
    Re: When email arrives in deleted folder

    Use a GRAPH request to get 999  emails and filter them to select only ones that created after last execution of your flow.

  • lmheimendinger Profile Picture
    260 on at
    Re: When email arrives in deleted folder

    That presents a whole different issue.  Get emails (V3) has a limit of 25 emails for one, and there is no definitive way to determine "new" deleted items as the only date field seems to be date sent.

     

    This wouldn't be a problem if the deleted folder was cleared out, but the user doens't want to do that for some reason, so her deleted folder > 6,000 items.  Yeah, I know.  

  • VictorIvanidze Profile Picture
    12,509 on at
    Re: When email arrives in deleted folder

    An email is not delivered to the Deleted items folder. It's or copied or moved.

    Don't use this trigger. Create a scheduled flow and scan the Deleted items folder periodically.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1