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

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
Highlighted
Community Support
Community Support

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

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,699)