Topics

Knowledge Creation Laboratory by CRM(xRM)

Let's connect Dynamics CRM using Microsoft Flow (Power Automate) - The latest hot topic

This post is a little later than planned. A typhoon is passing through the Kanto region tonight. I want to finish work early and go for a night drive.

This time, we decided to investigate a hot topic among some people in the company right now (although some say it's already past its prime, lol).
The topic is that when you sync your Outlook calendar with Google Calendar using Microsoft Flow, an infinite loop occurs, resulting in many duplicate appointments.

Description

What I'm trying to do

This time, I want to synchronize my Outlook calendar with Google Calendar so that I can check and register appointments from either one.

Environment

The following two calendars will be synchronized this time.
1. Conference room calendar created in Exchange
2. Schedule created with Google Calendar

The settings made this time

1. Sync events created in Outlook Calendar to Google Calendar
2. Sync events created in Google Calendar to Outlook Calendar

What happened

At first glance, they appear to be synchronized with each other and there are no problems, but when you actually try to run them, you will see that there is a problem.
Specifically, what's happening is that the events created in Outlook are synced to Google Calendar. Then the events just synced in Google Calendar are synced to Outlook. Then the events just synced in Outlook are synced to Google Calendar, and so on, forever, creating a ridiculous amount of identical events.

Thinking about a solution

Consideration 1: Comparing registered users

The idea was that there was a difference between the user created internally and the user registered by the system, and that this difference could be used to determine whether or not the user was allowed to post from the second time onwards and stop them from posting.
To verify this, I created a user other than the one used for synchronization in Microsoft Flow and created an event in Google Calendar.
Let's assume that the user who created the event is A and the user who is syncing is B. The execution results are as follows.

According to this, the user who wrote the event was synchronized, and the information was not overwritten with the information of the synchronized user.

Thought 2: Check for overlapping scheduled times

Next time I sync, I want to check if there are already events with the same date and time, so I looked at various actions, but I couldn't find anything that would allow me to specify conditions and retrieve data. There are options for sorting the list or retrieving a certain number from the top, but this means that every time I sync, I have to retrieve all the events and compare them one by one to see if there are any with the same date and time, which isn't practical...

as a result

At the moment, there is no practical way to avoid an infinite loop, but it would be much easier to use if future updates would allow us to specify conditions when retrieving data, rather than just sorting or specifying a higher ranking. So, please, Microsoft m(__)m

Person who wrote this article
Hiroaki Sakurada

During my ten-plus years of apprenticeship at a local company, I gained a wide range of experience in programming, networks, infrastructure, servers, maintenance, operations, sales, proposals, etc., and gained a broad, if not very deep, understanding of IT and work experience. Currently, I work hard every day to satisfy customers using a variety of services, primarily Dynamics CRM.
Recently, I've been struggling with the eternal question of which came first, the chicken or the egg.
I'm also slowly getting into mobile game development!

Articles in the same category