Power Automate
How to track the changes in Office 365 outlook events

How to track the changes in Office 365 outlook events

We may need to update calendar events details such as attendees, event details and etc. after the events created and those updates need to be tracked. We use SharePoint list and Power Automate to the automate this process.

Prerequisite:

We use SharePoint list to submit requests to create events in Office 365 outlook calendars/shared calendars. Create a new SP list to save ‘Start date’, ‘End Date’, ‘Calendar ID’ with appropriate column types.

Create a new Automated Flow with trigger ‘When an item is created in SharePoint’ and Add ‘Create event (V4)’ action available under ‘Office 365 outlook’ category and configure the create event action as follows,

  1. Select the Calendar (Calendars or Shared Calendars) from the Calendar Id dropdown.
  2. Enter Subject, Start Time and End Time, Time Zone and Body.
  3. Use below expression to enter Start Time and End time in the specified format.
formatDateTime(triggerOutputs()?['body/StartDate'],'MM/dd/yyyy HH:mm:ss')

4. Enter calendar body content as per the requirement.

Add ‘Update Item’ Action to capture the unique id of the created calendar event.

Once flow is ready, submit a request to SharePoint list for triggering this flow to create a calendar event. Flow gets triggered and calendar event is created whenever a new request is submitted to the SharePoint list. Unique calendar id is captured to the respective SP list item.

Next step is to create an automated flow triggers, when an event is updated/deleted to capture the updates occur in the calendar events into SharePoint.

  • Create a new flow and select ‘When an event is added, updated and deleted (V3)’ as trigger action.
  • Get body content in text format using ‘Html to text’ convert action.
  • Get the SharePoint list item ID using ‘Id’ property from trigger body output.

We can able to find whether the calendar event is added/updated/deleted using ‘Action type‘ from trigger body output. Here, we need to get the latest data from calendar when an event is updated.

Condition to check event is updated or not

In our scenario, we need to get the Updated Status from subject and Event Title & Participants from body content.

Subject has the Event Status value in the Subject separated by ‘/’ delimiter and Event Title, Participants and other details is available in body content (Ref Images under Prerequisite). Use the below expression in compose action to get status value from subject.

last(split(triggerOutputs()?['body/subject'],'/'))

Note : More properties are available in the output of trigger body such as ‘Required Attendees, Optional Attendees, Start Time, End Time, Location and etc.’

Next we can get the Event Title and Participants from body, using below expressions and our content has line break between two properties/values (Ref Images under Prerequisite).

// Event Title
trim(split(split(body('Html_to_text'),'Event Title :')[1],'Lead Host :')[0])

//Lead Host
trim(split(split(body('Html_to_text'), 'Lead Host :')[1], 'Participants :')[0])

//Participants
trim(split(split(body('Html_to_text'), 'Participants :')[1], 'Regards.')[0])

Using the output of the above compose actions, we can update our required properties in SharePoint list item.

Go to the calendar event that already created to modify the details such as Subject, Body content, Required attendees and etc. and click on the send update button. Second flow get started and updates the modified details to SP list.

Post your queries in the comment section. Happy Building šŸ™‚

0

Leave a Reply

%d bloggers like this: