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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Move Emails older than...
Power Automate
Unanswered

Move Emails older than 5 days from Inbox to another folder (individual maibox)

(0) ShareShare
ReportReport
Posted on by 13

Hi there, I have a client requirement and have done research into what the requirements are - hence created a flow as well but running into few issues.

 

Summary of requirement: Move Emails older than 5 days from Inbox to another folder within same mailbox everyday automatically.

MS Flow:

 

Saxenasush_0-1660045765045.png

Saxenasush_1-1660045811039.png

 

Questions:

- Does this flow look correct? I am doubtful.

- Is there a way to do more than 25 emails at a time at all? Emails older than 5 days could be 40-50 at a time for example.

- Any other way of doing this to achieve the brief?

 

Thanks all

 

Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @Saxenasush 

     

    The Flow is not what you need. 

    The delay is only stopping the Flow and restarting it after five days. 

     

    Here's what you need:

    Screenshot 2022-08-09 at 17.10.39.png

     

    Getting more than 25 emails is impossible since it's the max value in action. But if you run the Flow 2 times, the emails you get in the first time (older than five days) are not there, meaning that you'll get different emails to parse (until 25). You can do the first action manually and then let the Flow sync with the reduced number of elements.

     

    The expression in the comparison (right side ) is the following:

    addDays(utcNow(),-5)

     

    So we're checking if the received data was less than five days ago.

     

    Is this what you need?

    Cheers
    Manuel

    ------------------------------------------------------------------
    If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
    Otherwise, reply to it, and the community will do its best to help you.

  • Saxenasush Profile Picture
    13 on at

    Hi Manuel, Thanks for your help so far.

     

    I have changed the flow now but still have an issue.

    Currently the flow only scans the top 25 emails within the inbox from latest to oldest - so if there are 50 emails from today, the flow will not move any older emails as it will only check the top 25.

     

    Is there a search query I can add which can change the order of Getting emails from oldest to newest?

    I can see this can be done somehow but struggling to find the search query code or an example for this.

    Current flow:

     

    Saxenasush_0-1660100292390.png

     

     

  • Saxenasush Profile Picture
    13 on at

    Figured it out for anyone else who needs it:

    Adding an expression in the Search Query as per below skips the first 5 days and then starts the Get Emails command 🙂

     

    Saxenasush_0-1660105757124.png

     

  • manuelstgomes Profile Picture
    6,625 on at

    Good job!

    Cheers
    Manuel

    ------------------------------------------------------------------
    If I have answered your question, please mark it as "Accept as Solution." It will help other members find the solution faster. If you like my response, please give it a Thumbs Up. ?
    Otherwise, reply to it, and the community will do its best to help you.

  • t0m5k1 Profile Picture
    27 on at

    Is there a way to do this for mails older than 120 days from an inbox of over 4000 mails?

     

    Cheers,

    Tom

  • VictorIvanidze Profile Picture
    13,079 on at

    You can use native Outlook feature: https://www.extendoffice.com/documents/outlook/5238-outlook-move-items-older-than.html

  • t0m5k1 Profile Picture
    27 on at

    Thanks for the suggestion 😊 I looked in to that already, but unfortunately that only provides the archive functionality to an external PST file. This isn't what I'm looking for. I need to move the mail from one online mailbox folder to another.

  • VictorIvanidze Profile Picture
    13,079 on at
  • t0m5k1 Profile Picture
    27 on at

    Yep, and it seems that my company, in it's infinite wisdom, has set a 6 month retention on that folder too... In user generated folders I can set that to 7 years... go figure!

  • VictorIvanidze Profile Picture
    13,079 on at

    Understood. Did you try to use the flow provided above?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 291 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 238 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 109 Super User 2026 Season 1

Last 30 days Overall leaderboard