The duplicate triggers for New Events (ActionType = "added") is one of many bugs with this connector. In my case it happens about 20% of the time and the "Date" value is always exactly the same. This connector no longer gives us the "lastModifiedDateTime" property either so there's no way to tell which is more recent. And when the two triggers come in, almost all of their properties are the same except the "id". But the "iCalUId" property is the same.
Here's what I'm doing to avoid creating duplicates in my destination site:
1. Add a Delay for a random amount of seconds before searching for an existing entry in the destination site. This allows one of them to be processed ahead of the other since they came in at the same time: rand(5,60)
2. Search for a matching request by iCalUId: iCalUID eq 'triggerOutputs()?['body/iCalUId']'
3. For Single day events that will return an exact match. For Recurring events the iCalUId property is the same, so this returns a list of items. You need to compare the Start and End times to ensure its the entry you want. But the format of the date field in Sharepoint is different than what's returned by the connector so you have to format them equally:
formatDateTime(triggerOutputs()?['body/startWithTimeZone'], 'MM-dd-yyyy HH:mm:ss tt') is equal to formatDateTime(items('Apply_to_each')?['StartDateTime'], 'MM-dd-yyyy HH:mm:ss tt')
AND
formatDateTime(triggerOutputs()?['body/endWithTimeZone'], 'MM-dd-yyyy HH:mm:ss tt') is equal to formatDateTime(items('Apply_to_each')?['EndDateTime'], 'MM-dd-yyyy HH:mm:ss tt')
(You may need to change the 'Apply to each' , 'StartDateTime' and 'EndDateTime' references.)
Now the hard part:
4. We need to figure out which trigger is the most current. For that we compare the "id" of the trigger versus the one we stored in our destination site. (I created a field called "eventId" to store this value.)
triggerOutputs()?['body/id'] is greater than items('Apply_to_each')?['eventId']
** This is a mere text comparison and it actually works most of the time, but not 100%. I need to figure out how to convert the id's to numeric values to do that. Any ideas?
If the current event is more recent than the existing one we found, then update it.