0

I'm using a Flow to copy events from a calendar in one site to a calendar in another site. It is triggered on Item created or modified, then puts a rest call to get the item information (there are fields that are not part of the regular tiggerBody()), I use compose actions to modify the returned data, and then finally a POST rest call to recreate the event in the second site.

Over all it looks like it is working fairly well. Except for recurring all day events. For example I've put into the first calendar that I'll be taking three Fridays off -- I make it as an all day event and recurring for the next three Fridays. After all the processing my json looks like this:

{
    "Title": "All day PTO",
    "EndDate": "2020-01-24T23:59:00Z",
    "Description": null,
    "fAllDayEvent": true,
    "fRecurrence": true,
    "EventType": 1,
    "RecurrenceID": null,
    "Duration": 86340,
    "RecurrenceData": "<recurrence><rule><firstDayOfWeek>su</firstDayOfWeek><repeat><weekly fr=\"TRUE\" weekFrequency=\"1\" /></repeat><repeatInstances>3</repeatInstances></rule></recurrence>",
    "MasterSeriesItemID": null,
    "__metadata":
    {
        "type": "SP.Data.SabaListItem"
    },
    "SourceID": "55",
    "EventDate": "2020-01-10T00:00:00.0000000Z",
    "UID": "c9ab822d-33d7-44fa-b577-416f45dccc49"
}

I flow completes with no errors and the REST post shows a status code of 201. It all looks like it works well if I look at the calendar view in my second site.

enter image description here

But if I click the link to open the event I get a message Sorry, something went wrong Item does not exist. It may have be deleted by another user.

If I go to the All Events view I can edit the item and if I then save the item, it fixes the link on the other page! This leads me to believe there is some magic property that I need to set in order to properly create the recurring all day event in the first place.

I've tried googling "SharePoint create recurring event REST api" and similar. Unfortunately I'm only finding things about how to expand and get all the recurring events. I did find this thread which talks about two fields that don't seem to be on my list -- Recurrence and TimeZone. Neither of those are available and when I try to use them I get an message that they don't exist.

Has anybody used REST api to create recurring all day events? Any tips on what might be missing from my POST json?

Edit

Found this thread which indicates that the same issue has existed in the JSOM create code as well since at least May 2017. The only workaround they found was to change the url uses from the calendar view to open the event, but that isn't possible for me.

1 Answer 1

0

Turns out it this answer has the partial solution. But things have changed since June 2015.

I needed to add "TimeZone":0 (or to pass through whatever value the original event had, but all I've seen in zero).

The other part of that solution is to include a Recurrence property has changed and is not needed to create an all day recurring event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.