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

Get a push notification at 05:30 in the morning if I have received any emails during the night

Hi

 

We have a situation that a person wants to be woken up at 05:30 if a certain mail box has recieved any new emails during the night. Is this possible with flow, if so how?

1 ACCEPTED SOLUTION

Accepted Solutions
vecerpa
Memorable Member
Memorable Member

Hi @E_G,

 

Solution provided by @v-yuazh-msft is taking 10 latest unread messages that are in "Inbox" folder. No validation against time when they arrived. If you need so, there is needed to add one more condition to validate it. So finall Flow will looks like this:

 

 FlowEmailReport1.PNG

 

The formula in condition looks like this:

@greaterOrEquals(items('Apply_to_each')?['DateTimeReceived'],addhours(utcNow(),-8))

In this case the time is utcnow() that means 5;30 - 8hours that means 21:30 to make it simplier.

 

When there is met this condition then I'm setting help variable "isTrue" to true, variable is boolean. And after this loop I'm checking this variable and if it is true then I'm sending notification, if not nothing happen.

FlowEmailReport2.PNG

 

Hope this is helpful.

P.

 

 

View solution in original post

6 REPLIES 6
v-yuazh-msft
Community Support
Community Support

Hi @ E_G,

 

Do you want to get a notification at 05:30 everyday if there are new emails arrive during the night?

 

 

Please refer to screenshot below to run the flow at 05:30 everyday to check if there are new emails arrive during the night, if there are new emails arrive during the night,send a mobile notification to the user:

Capture.PNG

The expression in the condition as below:

@greater(length(body('Get_emails')), 0)

 

 

The flow would run successfully to send a mobile notification to the user if there are new emails arrive during the night as screenshot below:

 Capture.PNG

 

Regards,
Alice Zhang

E_G
Frequent Visitor

Thank you very much for your response. Would this flow take into account if for example you were to leave a message unread that arrived at 22:00 the same evening? Or does it only take into account the last 10 messages that are unread regardless when they were delivered?

vecerpa
Memorable Member
Memorable Member

Hi @E_G,

 

Solution provided by @v-yuazh-msft is taking 10 latest unread messages that are in "Inbox" folder. No validation against time when they arrived. If you need so, there is needed to add one more condition to validate it. So finall Flow will looks like this:

 

 FlowEmailReport1.PNG

 

The formula in condition looks like this:

@greaterOrEquals(items('Apply_to_each')?['DateTimeReceived'],addhours(utcNow(),-8))

In this case the time is utcnow() that means 5;30 - 8hours that means 21:30 to make it simplier.

 

When there is met this condition then I'm setting help variable "isTrue" to true, variable is boolean. And after this loop I'm checking this variable and if it is true then I'm sending notification, if not nothing happen.

FlowEmailReport2.PNG

 

Hope this is helpful.

P.

 

 

View solution in original post

E_G
Frequent Visitor

What an incredible forum, you just get the working solution served without doing any work 🙂 I will test this proposed solution asap. Thanks!

v-yuazh-msft
Community Support
Community Support

Hi @ E_G,

 

Have take a try to test it on your side?

Please let me know if your issue could be solved.

 

Regards,
Alice Zhang

E_G
Frequent Visitor

I believe I have it working now. Do you know if the variables one is comparing against, datetimereceived for example, is also in UTC or do I need to make corrections for time zones and DST etc?

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (3,040)