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

 

4 REPLIES 4
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.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,586)