Showing results for 
Search instead for 
Did you mean: 
Level: Power Up

Trigger a flow based on three emails on the same date?



I want to create a file in Onedrive if three new emails arrive on the same date. I have used three "when a new email arrives" triggers (Gmail). But I want it to only work if all three emails are on the same date. On the next day, I want to clear/cancel any previously running flows (if three emails were not found) and then start looking for new emails.


In short, only run when three emails are received on the same day, otherwise cancel.


Please guide me to do this, if possible.


I'd also curious to know for how long a flow can run and keep looking for the 2nd and 3rd email before canceling itself, if I don't set the "same date" rule.


EDIT: I notice that I can add a condition.  If Date from email1 = date from email2 = date from email3, then create a file. However, not sure how to just get the "date" and not "time."


Community Support Team
Community Support Team

Re: Trigger a flow based on three emails on the same date?

Hi @vividh ,


Why it is three emails on the same date. Is there any special purpose?

I am afraid I cannot understand too much about what your needs are. Please provide more explanation.

It seems  that configuring multiple when a new email arrives in a Flow does not fulfill your needs, because once a new email is received, the first trigger of the entire Flow will always excute.

I don't know if you understand what I mean, maybe you need to re-evaluate whether your needs can be achieved through MS Flow.

In addition, if you only want to get the Date received by the mail instead of Time, you could consider using formatDateTime() function.

Expression reference:


Image reference:5.PNG




Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,037)