cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Help Building Flow to push email based on Calendar event

Hi there,

Could someone please assit me with building a flow process for the following requirement:

 

Task: Server Maintenance Notification

Outcome: Email end user(s) to inform them of a scheduled maintenance 1 week and 1 day before the event.

 

Drivers: Office 365 Calendar set up with Events for each update window.

Event contains Client Names, Date, Time and message body.

 

Looking for a way for Flow to pull the information from the calendar and generate a email. 

 

Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yuazh-msft
Community Support
Community Support

Hi @Anonymous,

 

You could refer to screenshot below to create the flow:

Capture.PNG

 

If you want to email end user(s) to inform them of a scheduled maintenance 1 week before the event, you could enter the expression in the Delay Until as below:

addDays(triggerBody()?['Start'],-7)

If you want to email end user(s) to inform them of a scheduled maintenance 1 day before the event, you could enter the expression in the Delay Until as below:

addDays(triggerBody()?['Start'],-1)

Please take a try on your side and let mw know if your problem could be solved.

 

Best regards,

Alice

 

View solution in original post

11 REPLIES 11
v-yuazh-msft
Community Support
Community Support

Hi @Anonymous,

 

You could refer to screenshot below to create the flow:

Capture.PNG

 

If you want to email end user(s) to inform them of a scheduled maintenance 1 week before the event, you could enter the expression in the Delay Until as below:

addDays(triggerBody()?['Start'],-7)

If you want to email end user(s) to inform them of a scheduled maintenance 1 day before the event, you could enter the expression in the Delay Until as below:

addDays(triggerBody()?['Start'],-1)

Please take a try on your side and let mw know if your problem could be solved.

 

Best regards,

Alice

 

View solution in original post

Hello, @Anonymous!

Have you had an opportunity to apply @v-yuazh-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Anonymous
Not applicable

Sorry not just yet, I will try to have a go today.

Anonymous
Not applicable

@v-yuazh-msft@GabrielStJohn

I seem to get an error with this:
1.PNG

 

I set the Days to -1, clicked on Test, created a new calendar for Saturday and waited for the test to compelte.

Hi @Anonymous,

 

Please modify the expression in the "Delay Until" action as below:

addDays(formatDateTime(triggerBody()?['Start'],'yyyy-MM-ddTHH:mm:ssZ'),-1)

The flow would run successfully to run the delay until as below:

Capture.PNG  

 

 

Please take a try on your side and let mw know if your problem could be solved.

 

 

Best regards,

Alice

 

 

Anonymous
Not applicable

Thank you @v-yuazh-msft the expression is now working, are you able to help with the message body?
The email came out in the following format:
2.PNG

All I need in the body is 'Test' (under <p class = ... >)
Is it also possbile to format the start and end time into a user friendly output?

Hi @Anonymous,

 

Could you please share a screenshot of your flow and run details of the flow when the flow run failed?

Could you please share more details about your scenes?

 

I have made a test on my side,the Do until action should works if you use the expression that I provided:

addDays(formatDateTime(triggerBody()?['Start'],'yyyy-MM-ddTHH:mm:ssZ'),-1)

 

 

 

Best regards,

Alice

Anonymous
Not applicable

@v-yuazh-msft

 

Please see the flow below:

3.PNG

The Expression is now working fine.

4.PNG

 

I then received a test email, but the body was in raw HTML rather than formatted in a readable format.

2.PNG

 

Can you help clean up the body?
It does not look good if I send a client an email in HTML 🙂

Anonymous
Not applicable

@v-yuazh-msft
I think I have fixed the email

In the advance options I set 'Is HTML' to Yes and this fixed the formatting
Just the time is in full, not just HH:MM

formatDateTime(triggerBody()?['End'],'HH:mm')

Hi @Anonymous,

 

Do you want to get the Start time and End time with a hour and Minute type(HH:mm) in the email?

 

If you want to  get the Start time and End time with a hour and Minute type(HH:mm) in the email,

 

You could refer to screenshot below to format the Start time and End time:

Capture.PNG

 

The expression of start time as below:

 

formatDateTime(triggerBody()?['Start'],'HH:mm')

 

The expression of end time as below:

formatDateTime(triggerBody()?['End'],'HH:mm')

 

Please take a try on your side and let me know if your problem could be solved.

 

 

Best regards,

Alice

Anonymous
Not applicable

Thank you so much, you are the BEST!!!... now lets see which of your helpful posts I can mark as the solution 🙂

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (74,704)