Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Flow to filter mail by the time received

Can someone help me write expression to filter emails which received in specific time range? example: new mail received from 5pm-8am forward to another mailbox,



Advocate II
Advocate II

Sure thing, stick this in the trigger condition


@And(less(formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'hh:mm'), '08:00'),greater(formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'hh:mm'), '17:00'))


Please thumbs up this reply and mark it as a solution if it has helped you.


Thanks !


Hi @Godfather007  ,


1.You can use the trigger when a new email arrives (V3). 

2.Use condition to judge whether the reception time is greater than 18:00 or less than 8:00.

3.If the condition is true, proceed to the next step, if not, terminate the flow.




Best Regards,


Frequent Visitor

Thanks for both answers! First one really looks good and working.

I am really new to this stuff, how to add check in this place if trigger condition FALSE when terminate flow?


Hey. Trigger contains are cool

Hey @Godfather007 

Thanks for the reply. 


if the condition is FALSE the flow will not trigger at all. A trigger condition only triggers the initial step if the condition inside the trigger condition is true. 

if you can thumbs up my comment above and mark it as a solution. 


But strange thing if I try to test flow and get result TRUE - all good, but if I imitate FALSE result test dont giving Succeeded status and window stay "spin" 


With this trigger

@And(greater(formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'hh:mm'), '05:00'),less(formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'hh:mm'), '23:00')) 

How to add condition"if result false" when terminate flow?



Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,680)