cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jarge
Level: Powered On

two-way sync with calendars, check for existing event

I am trying to setup a 2way sync between google calendar and office 365 calendar. 

 

i am trying to insert a condition that checks if there is already an event that occurs at that time. 

 

has someone else been able to get this to work?

 

flow.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: two-way sync with calendars, check for existing event

Hi @jarge,

 

In addition to avoid the time range conflicts, we would alos need to consider the sync cycling.

If here you would like to filter if there is a same event created in Google calendar, then the office calendar should have a field to check with the Event Id generated from the Google Calendar.

To avoid the Sync cycling, we would need to configure the following two Flow:

Flow1

96.PNG

97.PNG

 

Flow 2:

98.PNG99.PNG

 

When an event is created under either calendar, it will trigger both flow to run, and depends on whether events exists at the other calendar, flow will do nothing or create a new Event.

 

To filter the Event time range conflicts, we could add another filter array action after the existing one. (Or you may combine it with the filter Array in the flow example above)

And change the condition after the Filter Array with an and:

@and(empty(body('Filter_array')),empty(body('Filter_array_2'))

formula in Flow One (Google Calendar as the trigger) of the second Filter Array should be:

@or(
And(LessOrEquals(triggerBody()?['start'],item()?['Start']),
    Less(item()?['Start'],triggerBody()?['end'])
  ),
And(less(triggerBody()?['start'],item()?['End']),
    LessOrEquals(item()?['End'],triggerBody()?['end'])
  )
)

For Office 365 as the trigger, it should be:

@or(
And(LessOrEquals(triggerBody()?['Start'],item()?['start']),
    Less(item()?['start'],triggerBody()?['End'])
  ),
And(less(triggerBody()?['Start'],item()?['end']),
    LessOrEquals(item()?['end'],triggerBody()?['End'])
  )
)

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: two-way sync with calendars, check for existing event

Hi @jarge,

 

In addition to avoid the time range conflicts, we would alos need to consider the sync cycling.

If here you would like to filter if there is a same event created in Google calendar, then the office calendar should have a field to check with the Event Id generated from the Google Calendar.

To avoid the Sync cycling, we would need to configure the following two Flow:

Flow1

96.PNG

97.PNG

 

Flow 2:

98.PNG99.PNG

 

When an event is created under either calendar, it will trigger both flow to run, and depends on whether events exists at the other calendar, flow will do nothing or create a new Event.

 

To filter the Event time range conflicts, we could add another filter array action after the existing one. (Or you may combine it with the filter Array in the flow example above)

And change the condition after the Filter Array with an and:

@and(empty(body('Filter_array')),empty(body('Filter_array_2'))

formula in Flow One (Google Calendar as the trigger) of the second Filter Array should be:

@or(
And(LessOrEquals(triggerBody()?['start'],item()?['Start']),
    Less(item()?['Start'],triggerBody()?['end'])
  ),
And(less(triggerBody()?['start'],item()?['End']),
    LessOrEquals(item()?['End'],triggerBody()?['end'])
  )
)

For Office 365 as the trigger, it should be:

@or(
And(LessOrEquals(triggerBody()?['Start'],item()?['start']),
    Less(item()?['start'],triggerBody()?['End'])
  ),
And(less(triggerBody()?['Start'],item()?['end']),
    LessOrEquals(item()?['end'],triggerBody()?['End'])
  )
)

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Miccal
Level: Power Up

Re: two-way sync with calendars, check for existing event

can a third flow be added to modify events in either o365 or google if the event time is changed?

partykai
Level: Powered On

Re: two-way sync with calendars, check for existing event

How could this be implemented on two calendars in o365?

i cant seem to get the ID to be checked from one Calendar in o365, to another..

just keeps looping.

daoreshina
Level: Power Up

Re: two-way sync with calendars, check for existing event

Thanks!

How to make it work this way, when events are modified and/or deleted?

 

jefftaste
Level: Powered On

Re: two-way sync with calendars, check for existing event

Having some issues with this.  Has anyone used the when Events are added,modified, or deleted trigger for this.  Trying to habdle all the cases for proper two way sync.

 

Unfortunalty I am not sure what is going on but doesnt seem to be working.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,512)