web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SharePoint Calendar - ...
Power Automate
Answered

SharePoint Calendar - Recurring Event and Create Item Action

(0) ShareShare
ReportReport
Posted on by 38

Help! I created an out-of-office calendar for work and have issues when an event is recurring.

 

I have a Request Time Off calendar where different teams submit their request in this one calendar and once approved, it creates/posts the item to their respective team's out-of-office calendar. For example, a person from the Admin Team submit a request through the Request Time Off calendar and got approved by the manager, the request will now be posted in both the Request Time Off calendar and the Admin out-of-office calendar.

 

Everything's working fine except I noticed that when an event is recurring - the recurring settings don't carry over on the individual team's calendar. For example, if someone requests time off every Wednesday starting today the 23rd till the end of next month and got approved, it will show up on the team's OOO calendar as the range of the recurrence Feb 23 - March 30 instead of just every Wednesday - Feb 23, March 2, March 9 so on and so forth.

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @sharepointuser1,


    Can you share a screenshot of the current setup of your flow? This will help us to troubleshoot the root cause of your issue/challenge.

  • sharepointuser1 Profile Picture
    38 on at

    Yes, of course - thank you! @Expiscornovus 

     

    sharepointuser1_0-1645763480046.pngsharepointuser1_1-1645763496467.png

     

  • Verified answer
    Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @sharepointuser1,

     

    The challenge is that the when an item is created trigger action doesn't include the RecurrenceData field. You have to add another request in your flow to retrieve these values.

     

    After that you could create a new event item in the target list with a Send an HTTP request to SharePoint action. 

     

    Below is an example of that approach.

    Btw, you can still reuse your create Item action in the If no section.

     

    Uri to retrieve RecurrenceData of created item

    _api/web/lists/getbytitle('Events')/items(@{triggerOutputs()?['body/ID']})?$select=*,Duration,RecurrenceData

     

    Expression to retrieve fRecurrence field in the Condition action:

    body('Send_an_HTTP_request_to_SharePoint_-_GET_RecurrenceData')['d']['fRecurrence']

     

    Body for the creating the new event item in the target list. It includes an expression to retrieve the RecurrenceData (xml) value. The replace function is used to replace " by the ' character.

    {
    "Title": "@{triggerOutputs()?['body/Title']}",
    "EventDate": "@{triggerOutputs()?['body/EventDate']}",
    "EndDate": "@{triggerOutputs()?['body/EndDate']}",
    "EventType": @{triggerOutputs()?['body/EventType']},
    "fRecurrence": true,
    "RecurrenceData": "@{replace(body('Send_an_HTTP_request_to_SharePoint_-_GET_RecurrenceData')['d']['RecurrenceData'], '"', '''')}"
    }

     

    recurrencedata_createitem.png

  • Assepa Profile Picture
    182 on at

    Hi,

     

    in the condition action, the expression below is equal to ? (undefined....)

    body('Send_an_HTTP_request_to_SharePoint_-_GET_RecurrenceData')['d']['fRecurrence']

    I tried with equals to TRUE but it doesn't copy like I wanted to:

    In my SharePoint calendar A I create this event

     

    Assepa_0-1650031785638.png

    Assepa_1-1650031866187.png

     

    Once the flow is triggered I have this result in my SharePoint Calender B

    I don't have two seperate Event on 19 and 26, but one event that start on 19 till the 26

    Assepa_2-1650032006675.png

     

     

    Also is it possible to copy recurring event from SharePoint calendar to a SharePoint list ?  

     

    Thanks!

  • Community Power Platform Member Profile Picture
    on at

    @Expiscornovus Thanks for your help!

     

    I did some testing with recurring events and there is one issue I can't solve:

     

    My flow works fine like this (repeat instances does not match with difference between start and end in this example but results are the same when it does)

    CRM1.PNG

     

    So the event gets created in my calendar but something is weird

     

    CRM2.PNG

     

    When I click on one of the events, an error occurs (It means like: That did not work. The item does not exist. It may have been deleted by another user.

     

    CRM3.PNG

     

    But if I open the list view of my calendar, I can see the event, open and even edit it

     

    CRM4.PNG

    CRM5.PNG

    I noticed that if I change something and save the event, I now can open the single events in the calendar view.

    Another (and probably my biggest problem) is that these events seem to do not get transferred into my synchronized outlook calendar.

     

    Do you have any ideas on what is causing these two issues and how to solve it?

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Anonymous,

     

    Just to double check. I see you are using the following value as an EndDate 2022-05-25T12:00:00. 

     

    But as far as understand from your settings you want to have use a daily recurrence pattern which stops after 4 repeats. Based on your start date should the EndDate value not be 2022-05-21T12:00:00? 

     

    Or do you only want it to run on weekdays? In that case it probably needs to be the 23th and you need to include the Weekday='True' part to your RecurrenceData xml as well.

     

    Can you try something like below and see if that makes a difference?

    {
    "Title": "TestWeekday",
    "EventDate": "2022-05-18T07:00:00Z",
    "EndDate": "2022-05-23T11:00:00Z",
    "EventType": 1,
    "fRecurrence": true,
    "RecurrenceData": "<recurrence><rule><firstDayOfWeek>su</firstDayOfWeek><repeat><daily weekday='TRUE' /></repeat><repeatInstances>4</repeatInstances></rule></recurrence>"
    }

     

  • Community Power Platform Member Profile Picture
    on at

    Hi @Expiscornovus,

     

    Thanks for your reply!

     

    I tried your code and it still does not work.

    As far as I understand, the enddate is not important for the request as long as I include the repeat instances.

    Even if the start and enddates are matching with the repeats (with or without weekdays only), the events are created weirdly as described above.

    So the events are created in my Sharepoint calendar but I can't open them unless I open the main event in the list view of the calendar and save it.

    Maybe there is some information missing in my code but I can't find the problem.

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Anonymous,

     

    I am able to reproduce this issue now. So, I think you are right, there is missing something in the code, it is not storing the pattern correctly.

     

    Let me have a look if I can find the cause. 

  • Navin21 Profile Picture
    2 on at

    Hey @Expiscornovus 

    Did you find any solution? I am also facing the same issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard