Exercise - Create a flow that blocks time on your calendar

Completed

Have you ever run into a situation where you're away from your work device for an unplanned, extended period of time? Wish you had a way to block your work calendar and let your manager know? Then this is the unit for you! In a few clicks, you can modify an existing template, and then have it available to trigger from the Power Automate mobile app.

Prerequisites

  • Access to Power Automate.

  • Access to Power Automate mobile app.

  • A basic understanding of Power Automate and experience with creating a flow is recommended.

Open the template

  1. Launch Power Automate and sign in using your organizational account.

  2. Select Templates and search block calendar.

    Screenshot of the block calendar template.

  3. Select the Block out my Office 365 calendar for an hour tile.

  4. Select Continue.

First we update the Create Event action from the template to find the Calendar where the event should be created. We also set the start and end times so it only blocks an hour on the calendar.

  1. Select the Create Event step. Delete the string in the Calendar ID parameter by clicking the x in the right hand corner.

  2. Select the calendar you want to create an event on. For this exercise, I'm selecting Calendar.

    Screenshot showing where to click to select the calendar.

  3. Delete the Date parameter that was automatically added to the Start Time field.

  4. Type / in the Start Time field and then Dynamic Content. Search for the Timestamp property and select it.

    Note

    If you don't see the Timestamp property, you may need to click See More in the right hand corner of the Dynamic Content pane next to Manually trigger a flow.

  5. Delete the Timestamp from the End Time field. Select inside the End Time field and then select the blue fx to bring up the expressions panel. Copy and paste this expression in the expressions panel and select Add.

    addHours(triggerOutputs()['headers']['x-ms-user-timestamp'],1)

    Note

    This expression adds 1 hour from the time the flow is triggered.

  6. Update the Time Zone field to match your time zone.

Here's what the updated Create Event action looks like.

Screenshot of the create event action.

Next, we're going to send an email notification to our manager, to do this we use the combination of Get my profile (V2) and Get manager (V2).

  1. Select + Insert a new step and then select Add an action.

  2. Search for Office 365 Users and select the Get my profile (V2) action. This action provides us with the User Principal Name.

  3. Select + Insert a new step and then select Add an action again.

  4. Search for Office 365 Users and select the Get manager (V2) action.

  5. Type / in the User (UPN) field and then select Insert dynamic content.

    Screenshot of the insert dynamic content button.

  6. In Dynamic content, select UPN. Make sure you select the UPN that is under the Get my profile (v2).

    Screenshot of user principal name.

  7. Select + Insert a new step and then select Add an action.

  8. Search for Outlook and select the Send an email (V2) action.

  9. Type / inside the To field and select Insert dynamic content.

  10. In Dynamic content select Mail under the Get manager (V2).

    Screenshot of get manager mail.

  11. Finally, you can add your desired text in the Subject and the Body section. Here's an example:

    Screenshot of subject and body.

Here's an overview of the entire flow:

Screenshot of block calendar flow overview.

And here's what the flow looks like in the Power Automate mobile app:

  1. Select Instant Flows.

  2. Select the Block out my Office365 calendar for an hour flow.

  3. Select Run Flow.

    Screenshot of block calendar flow overview in the mobile app.