cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jpineiro
Frequent Visitor

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

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

 

This is what advanced contain produced..

 

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

2 REPLIES 2
v-micsh-msft
Community Support
Community Support

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

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

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')
           )
      )

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,425)