Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

Use Power Automate to forward Outlook events upon registration

Posted on January 29, 2023January 29, 2023 by Tom

“I have a form where users can register for trainings, now I’d like to forward the Outlook events to them, can I do it with Power Automate?”


If you ever organised events, you probably noticed a pattern in some user’s behaviour – if it’s not in the calendar, it doesn’t exist. It’s not a problem when you invite users to a meeting directly, but what about optional events? For example a training session users can join upon registration? They visit a registration page, select the training with a date, and submit the registration. And forget about it.

Unless they receive an invitation into their calendars…

You’ll need the event id…

To forward an event you’ll always need the event id. You can get it using the ‘Get events’ action with some filters, but as some events can have the same name I prefer to take one more step back. Instead of creating the event manually build a flow that’ll create it for you. Such flow will give you the event id that you can store in a separate location, e.g. a SharePoint list.

… to forward the event (updated 01/2023)

Since I encountered issues with the ‘Update event’ action where some users received multiple invitations, I had to look for another solution. And the solution is an HTTP request! Add the ‘Send an HTTP request’ action from the Office 365 Outlook and configure it as below.

Uri:
https://graph.microsoft.com/v1.0/me/events/<eventId>

Method:
PATCH

Body:
{
  "attendees": <arrayWithAttendees>
}

The <eventId> you already know, but the <arrayWithAttendees> is something you must prepare. Since you’re updating the event, you can’t enter just the new attendee. You must keep also the already invited users and extend the attendees by the new email address.

To do this, start by initialising an array variable, e.g. var_attendees.

Get the event with the ‘Get event’ action and check whether there’re already any attendees. If there’re, use the ‘Select’ action to prepare an array in the required format.

[
  {
    "emailAddress": {
      "address": "<attendee1>"
    }
  },
  {
    "emailAddress": {
      "address": "<attendee2>"
    }
  },
  {
    "emailAddress": {
      "address": "<attendee3>"
    }
  }
]

Input all the attendees provided by the ‘Get event’ action, and split them by ; to split them into email addresses.

split(outputs('Get_event_(V3)')?['body/requiredAttendees'],';')

Use them to create the emailAddress property.

{
  "address": @{item()}
}

Once you have the previous attendees prepared, you can append an object with the new approver into the array…

{
  "emailAddress": {
    "address": "<newAttendee>"
  }
}

…and extend the invitation with the HTTP request.

Original approach: can lead to multiple invitation emails!

Once you have the event id, you can forward the event. There’s no action called ‘Forward an event’, but you don’t need it. Since the event was created in your calendar, you can use the ‘Update event’ action to update it. As long as you have the id…

Firstly, get the event with the ‘Get event’ action. This action is needed to get all the information about the event.

Secondly, add the ‘Update event’ action and use all the event information you got, otherwise some of it might be removed. Add the registered user email address to the ‘Required attendees’ and he’ll receive the invitation.

Power Automate send outlook events

Important note: if you’re not in the UTC timezone you must convert the Start time and End time into your local timezone!

Summary

When you allow users to register for events, you should always forward them an invitation in their Outlook calendar, either manually or with a Power Automate flow. What you need for a flow is just the event id, once you have it you just keep updating the event with the new attendees as they come.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

  • How to find Excel rows missing in SharePoint list (Power Automate)March 29, 2023
  • Check whether user exists in AAD with Power AutomateMarch 26, 2023
  • How to highlight whole SharePoint row based on calculated dateMarch 22, 2023
  • Why is your Power Automate flow running so slow?March 19, 2023
  • How to add multiple links to the Power Automate approval taskMarch 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes