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 / Create buffer either s...
Power Automate
Unanswered

Create buffer either side of SharePoint calendar item

(0) ShareShare
ReportReport
Posted on by 386

Hello everyone!

 

I want to create a flow that will automatically book 30 minutes before and 30 minutes after out in a SharePoint calendar, after the item has been created in the calendar.

 

The trigger is a MS Form that has the date and time as questions, then eventually I have an action to automatically add the item into the calendar which works perfectly. 

 

JoshPullan11_0-1662560590933.png

 

Is there anyway now to automatically add a 30 minute item into the calendar before the defined start time and after the defined end time.

 

I've tried a few different ways but nothing seems to be working for a calendar item.

 

Purpose of the flow is that users request someone to attend a booking, however there needs to be travel time considered for moving between sites. Therefore if someone is booked to attend a site 13:00 - 15:00, then I need to automatically add the 30 minutes before and after this to account for travel/setup.

 

Side note, my knowledge on power automate is fairly basic, so any help would be greatly appreciated!

 

Thanks,

Josh

Categories:
I have the same question (0)
  • Verified answer
    Jap11 Profile Picture
    386 on at

    I eventually resolved this myself - sharing in case anyone else ever has this issue.

     

    JoshPullan11_0-1662739984795.png

    JoshPullan11_1-1662740019135.png

     

    Adding Minutes

    addMinutes(triggerOutputs()?['body/EndDate'],30)

     

    Subtracting Minutes
    subtractFromTime(triggerOutputs()?['body/EventDate'], 30, "Minute")

     

    It did loop the flow though so had to put a terminate function in there as well.

     

     

     

  • SL-23071500-0 Profile Picture
    41 on at

    Any idea on how to make this work for Outlook events? Adding a before event buffer and after event for travel time?  Struggling.  Nothing seems to work, keep getting errors.

  • Jap11 Profile Picture
    386 on at

    Hello - you can try this, seemed to work for me 🙂

     

    JoshPullan11_0-1673377685670.png

     

    JoshPullan11_1-1673377729664.png

     

    Add Minutes: addMinutes(triggerOutputs()?['body/End'], 30)

     

    Sub Minutes: subtractFromTime(triggerOutputs()?['body/Start'], 30, 'Minute')

     

    When run successfully, you will see a total of 3 runs, the first is for your actual event added to your calendar and the other 2 will be the before and after events being added from the first run. However because they have Buffer in the subject, it prevents the flow from looping.

     

    JoshPullan11_0-1673378210520.png

     

     

    Hopefully that makes sense and helps!

  • SL-23071500-0 Profile Picture
    41 on at

    I really appreciate this.  I copied your syntax exactly. With the exception of my time zone has to be UTC. (When I switch it to Mountain time, the buffer ends up being several hours later.)  So wierd.   got this error..

     

    ***Unable to process template language expressions in action 'Create_event_(V4)_3' inputs at line '0' and column '0': 'The template language function 'addMinutes' expects its first parameter to be a string that contains the time. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#addminutes for usage details.'.

     

    so frustrated...

  • SL-23071500-0 Profile Picture
    41 on at

    It also didn't prevent the loop.  I had close to 3800 "buffer" appointments added to my outlook before I had to completely delete it to get it to stop.  But, I had TWO conditions.  This only needs to happen when the appt is set to oof or out of office, AND the subject isn't buffer.  Interestingly, it ignored the if subject does not contain buffer, and added buffers to buffers to buffers.

     

    I'm going to try to start over and put a terminate at the end of both yes and no so it NEVER loops.

     

  • SL-23071500-0 Profile Picture
    41 on at

    That worked!  Here's my whole flow.  Had to separate the conditions.

    slarson77_0-1673393665272.png

    Thanks for all the help!

  • Jap11 Profile Picture
    386 on at

    That's awesome to hear! Did the syntax that I shared work in the end then or did you have to make any changes?

     

    I experienced a similar issue with loads of buffer appointments been added to my calendar however it sounds like we both got there in the end! 

  • SL-23071500-0 Profile Picture
    41 on at

    Your syntax did work, but I had to manually type it.  Even though it was exact, the copy/paste of it made it not work. Thank you so very much!  I have a lot of amazing flows I may share in this group.  The struggle is real for beginners.  

  • Jap11 Profile Picture
    386 on at

    Yes you should definitely share them! I'm a beginner as well and have taught myself, so when people post their flows on here I find it so helpful!

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard