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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Prevent double booking...
Power Automate
Unanswered

Prevent double booking SharePoint calendar for the day

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

The goal of the flow is to prevent double cooking if the category has been assigned for the day (no need to check time) of the calendar. This is what I have so far. If the category is chosen, do not save the item, send email about the double booking.

 

So for example, April 10, 2019, Category = Meeting then someone trying to book again for the same day and trying to choose Category = meeting, do not save, send email.

 

condition.jpg

 

Thanks for the help.

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Do you want to check if the selected category already exists or not? If it already exists (for the same day), delete the newly added one and send an email, stopping double booking.

     

    I have set up the flow likes below. In the following scenario, I am going to check the booking for the same day and stop duplicate booking for one category.

     

    Add trigger When an item is created or modified. Manually enter the name of the calendar list.

     

    Add action Get items, input the code likes below in the Filter query field to filter out events that start on the same day and with the same category.

     

    Then add a Condition with following code:

     

    length(body('Get_items')?['value'])
    
    is greater than
    
    1

     

    Under if yes branch, add action Delete item. Make sure select dynamic content ID from the trigger.

    1.PNG

     

    Best regards,

    Mabel

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for this reply. I followed your flow but somehow, the yes condition is not working. Section value is a lookup field.

    lookup.jpg

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The yes condition is working now but the original copy is the one getting deleted. I double checked the correct ID is used.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Looks like I got some parts to work now but I am having an issue with infinite loop of flow for the NO condition since an Update Item action is considered "MODIFIED" so it will go to the top and run the flow again and again.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think the condition is not working because it is deleting all the entries for the day.

    2.jpg

  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Thanks for updating.

     

    In the action Delete item, please make you select the dynamic content ID from the trigger, then it will only delete the newly created one when the condition match.

     

    If you want to update item under If no branch, to get rid of an infinite loop, pleas change the trigger to “When an item is created”.

     

    I have made another test and it does work as expected.

    1.PNG

     

    Best regards,

    Mabel

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for this reply. I got this create item trigger to work but the problem is when a user modify an item, this trigger..

  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I guess that you are using the trigger “When an item is created or modified”. If so, the flow will be triggered whenever a new item is created or an existing item is modified.

     

    I suggest use the trigger “When an item is created” so that the flow won’t be triggered when the existing items are updated/modified.

     

    Hope this make sense.

     

    Best regards,

    Mabel

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    because create or modified triggers are required to make sure no double booking of the section or category.

  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I got it. How about removing the action Update item?

     

    Without using the action Update item, the flow won’t be triggered infinitely.

     

    Best regards,

    Mabel

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 636

#2
Valantis Profile Picture

Valantis 372

#3
11manish Profile Picture

11manish 335

Last 30 days Overall leaderboard