cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
vividh
Level: Power Up

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

Hi,

 

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."

 

1 REPLY 1
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:

formatDateTime(triggerBody()?['DateTimeReceived'],'yyyy-MM-dd')

Image reference:5.PNG

 

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

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 176 members 5,998 guests
Please welcome our newest community members: