cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Saxenasush
New Member

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

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

 

29 REPLIES 29
manuelstgomes
Community Champion
Community Champion

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
New Member

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
New Member

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
Community Champion
Community Champion

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
Regular Visitor

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

 

Cheers,

Tom

VictorIvanidze
Community Champion
Community Champion

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

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

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
Community Champion
Community Champion

OK. Did you test the archive mailbox (https://support.microsoft.com/en-us/office/manage-email-storage-with-online-archive-mailboxes-1cae7d...)?

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

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
Community Champion
Community Champion

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

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

I think so

t0m5k1_1-1675843186593.png

Should it look like that?

oops I see a mistake in that one... 😞 let me change that quickly

Looks like it might be working... sort of. It only does 25 at a time, but I can modify the schedule once all the mails are in 🙂 

Thanks for taking the time to help @VictorIvanidze really appreciate it

VictorIvanidze
Community Champion
Community Champion

Yes - in the search query 😉

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
VictorIvanidze
Community Champion
Community Champion

To radically speed it up you have to use a GRAPH request instead of Get emails.

 

If you are running only Outlook for Windows, you can create a script or an add-in.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Sorry for the n00b question, but how would I set up that GRAPH request? 🙂

VictorIvanidze
Community Champion
Community Champion

Play a bit with GRAPH explorer. Search here for GRAPH.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Just FUY: a flow that using a non-premium GRAPH actions can move 5000 email during one hour.

If this acceptable for you?

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Hi @t0m5k1,

have a look at this freeware flow: https://ivasoft.com/archiveemailsflow.shtml 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,500)