web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow Notification when...
Power Automate
Unanswered

Flow Notification when new email between certain times? @contains(triggerBody()?['DateTimeReceived'

(1) ShareShare
ReportReport
Posted on by 30

How can we code, when we get email between 7pm and 9pm?

 

This is what advanced contain produced..

 

@contains(triggerBody()?['DateTimeReceived'], '') 

Categories:
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Jpineiro,

     

    Microsoft Flow handles time in UTC format, so in order to make the flow to work with your local timezone, here we take use of the addhours function to add the UTC offset.

    For example, in Beijing TimeZone,  the formula below would Add 8 hours.

    Addhours(triggerBody()?['DateTimeReceived'],8,'HH:ss')

    Please find your timezone and then modify the 8 with the UTC offset for your timezone.

    So the whole formula for the condition should be:

    @and(
     GreaterOrequals(
     Addhours(triggerBody()?['DateTimeReceived'],UTCoffset,'HH:ss'),
     formatDateTime('19:00','HH:ss')
     ),
     lessOrEquals(
     Addhours(triggerBody()?['DateTimeReceived'],UTCoffset,'HH:ss'),
     formatDateTime('21:00','HH:ss')
     )
     )

    Regards,

    Michael

  • ISD Development Profile Picture
    30 on at

    Thank You.  I'm in EST, and have been trying this (this morning) with no success.  Condition always comes back false though email is recieved between 6am and 10am.  I tried -5 too, with no luck. Thanks!

     

    @and(
            GreaterOrequals(
                       Addhours(triggerBody()?['DateTimeReceived'],5,'HH:ss'),
                       formatDateTime('6:00','HH:ss')
              ),
             lessOrEquals(
                       Addhours(triggerBody()?['DateTimeReceived'],5,'HH:ss'),
                       formatDateTime('10:00','HH:ss')
               )
          )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard