cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Power Participant
Power Participant

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

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

Highlighted
Frequent Visitor

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?

Highlighted
Power Participant
Power Participant

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

Highlighted
Frequent Visitor

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!

Highlighted
Community Support
Community Support

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

Highlighted
Frequent Visitor

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
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (4,771)