cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (3,782)