cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
E_G
Level: Powered On

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
Super User
Super User

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

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

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

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
Level: Powered On

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

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?

Super User
Super User

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

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
Level: Powered On

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

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

Community Support Team
Community Support Team

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

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
Level: Powered On

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

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,423)