cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jarge
New Member

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
v-micsh-msft
Community Support
Community Support

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
v-micsh-msft
Community Support
Community Support

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.

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

Anonymous
Not applicable

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.

Thanks!

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

 

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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,615)