Microsoft 365 Microsoft Graph Power Automate

No time to manage your calendar? Let Power Automate assist your response to calendar invites using Microsoft Graph connectors

Hi there! I would like to share a solution about a scenario/challenge that I personally experienced in the past when I was a consultant.

Consultants or anyone who works with customers day to day bases may know that we spend the entire day with our customers to plan/work together on our projects.

Meetings after meetings -recurring everyday-, we almost never have time to check our e-mails. Most of us also miss the new meeting invites for the next day and never get a chance to say “I have a conflict in my calendar”.

So, we may end up having meetings conflicting in the calendar and unable to attend half of it. Sounds familiar?

What if we build a flow in Power Automate using out of the box Microsoft Graph connectors to check calendar availability, every time when there is a new calendar event received? May our flow be able to send a accept/tentative/decline response automatically according to user’s calendar status? Yes, of course it can!

Power Automate has hundreds of Microsoft Graph powered out of the box connectors to get e-mails, post messages to Teams, send a calendar invite and many more. However, not all M365 datasets are available in this collection of built-in connectors. If you are interested in using any M365 dataset in your project, Microsoft Graph Power Automate Tutorial shows how to build a custom connector and consume it in the Power Automate flow.

For this example, We have the right out of the box connectors to design the scenario. Process will be similar to the flow shown below:

Let’s build our flow in Power Automate

Go to https://flow.microsoft.com and select Create on the left hand side menu and choose Automated flow.

Give a name to your flow and choose your flow trigger as When a new event is created (V3). Select Create.

In the flow, add the following connectors and fill the fields as follows:

  • When a new event is created (V3)
  • *Calendar id: [Calendar]
  • Get Event (V3)
  • *Calendar id: Calendar
  • *Item id: [Id] (Dynamic content/When new event is created (V3))
  • Get calendar view of events (V3)
  • *Calendar id: Calendar
  • *Start time: [Start time] (Dynamic content/Get Event (V3))
  • *End time: [End time] (Dynamic content/Get Event (V3))

  • Filter array
    *From: [value] (Dynamic content/Get calendar view of events (V3))
  • *Choose a value: [Id] (Dynamic content/Get calendar view of events (V3))
  • *Filter: is not equal to
  • *Choose a value: [Id] (Dynamic content/Get Event (V3))
  • Condition
    *Choose a value: length(body(‘Filter_array’))
    (Expression)
  • *Condition: is less than or equal to
  • *Choose a value: 0

  • IF YES
  • Respond to an event invite (V2)
    *Event Id: [Id] (Dynamic content/Get Event (V3))
  • *Response: Accept
  • *Comment: Looking forward to talk to you soon!
  • *Send Response: Yes
  • Post a message as the Flow bot to a user (Preview)
  • *Recipient: { your recipient e-mail here }
  • *Message: [Subject] (Dynamic content/Get Event (V3)) organized by [Organizer] (Dynamic content/Get Event (V3)) is accepted and added in your calendar.
  • *Headline: Meeting accepted!
  • IF NO
  • Get calendar view of events (V3)
    *Calendar Id: Calendar
  • *Start Time: [End time] (Dynamic content/Get Event (V3))
  • *End Time: addDays(body(‘Get_event_(V3)’)?[‘end’],1)
    (Expression)
  • Condition
  • *Choose a value: length(body(‘Get_calendar_view_of_events_(V3)_2’)?[‘value’])
  • (Expression)
  • *Condition: is greater than or equal to
  • *Choose a value: 5
  • IF YES
  • Respond to an event invite (V2)
    *Event Id: [Id] (Dynamic content/Get Event (V3))
  • *Response: Decline
  • *Comment: Hi, unfortunately there is a conflict in my calendar. So, I won’t be able to join this meeting today. Can we meet any other day?
  • *Send Response: Yes
  • Post a message as the Flow bot to a user (Preview)
  • *Recipient: { your recipient e-mail here }
  • *Message: [Subject] (Dynamic content/Get Event (V3)) organized by [Organizer] (Dynamic content/Get Event (V3)) is declined.
  • *Headline: Meeting declined!
  • IF NO
  • Send email with options
    *To: Organizer (Dynamic content/Get Event (V3))
  • *Subject: Tentative: Can we reschedule?
  • *User Options: Yes, No
  • Post a message as the Flow bot to a user (Preview)
  • *Recipient: { your recipient e-mail here }
  • *Message: [Subject] (Dynamic content/Get Event (V3)) organized by [Organizer] (Dynamic content/Get Event (V3)) is conflicting with other meetings. We realized you have some availabilities in your calendar and asked [Organizer] (Dynamic content/Get Event (V3)) to reschedule.
  • *Headline: Reschedule requested!

Test the scenarios!

Select Save and Test on the right hand side bar and choose I’ll perform the trigger action to test your flow.

The flow is tracking the following account’s calendar: Mod Administrator (admin@M365x716122.onmicrosoft.com)
The user who sends the calendar invites: Ayca Bas (aycabas@M365x716122.onmicrosoft.com)

Scenario 1: No Conflict

Ayca Bas sends a calendar invite to the Mod Administrator. If there is no conflict in Mod Administrators’ calendar, Ayca Bas will receive an Accepted response, and Flow bot will notify Mod Administrator about the taken action.

Ayca Bas receives:

Mod Administrator receives:

Scenario 2: Conflict, calendar is not busy for the day

Ayca Bas sends a calendar invite to the Mod Administrator. If there is a conflict in Mod Administrators’ calendar but there are less than 5 events for the day, Ayca Bas will receive a Tentative response, requesting to reschedule the meeting. Flow bot will notify Mod Administrator about the taken action.

Ayca Bas receives:

Mod Administrator receives:

Scenario 3: Conflict, calendar is busy for the day

Ayca Bas sends a calendar invite to the Mod Administrator. If there is a conflict in Mod Administrators’ calendar and there are more than 5 events for the day, Ayca Bas will receive a Decline response. Flow bot will notify Mod Administrator about the taken action.

Ayca Bas receives:

Mod Administrator receives:

Solution package.zip file can be found under the following repository: My Calendar Manager.

Leave a Reply

%d bloggers like this: