Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Stop Double Booking

(0) ShareShare
ReportReport
Posted on by 2
I have a "BikeBook" list where users can book bikes. When a new item is created, I want to check the values of BikeName, BookingDate, and BookingStartTime. If another item is created with the same BikeName, BookingDate, and BookingStartTime, the item should not be created, and an error message should be displayed. I want to prevent double booking for the same bike, on the same date, and at the same time. How can I achieve this using Power Automate?
  • Vishwanth Profile Picture
    2 on at
    Stop Double Booking
     
    Thank you so much for your in-depth explanation and details. I have tried it, and as suggested by you, I would like to go with PowerApps (Form). I would also like to stop the booking before creating the item itself and display an error message. Can you please guide me or provide a step-by-step guide?
     
    we have another column , which is BookingEndTime which is a calculated column BookingStarttime + 30 min , means every booking last for 30 min .
    Thank you in Advance. 
  • Expiscornovus Profile Picture
    32,022 Most Valuable Professional on at
    Stope Double Booking
     
    Normally my suggestion in this scenario would be to not use Power Automate for this, because the item is already created. So, you are not preventing it from being created but you are checking if it is duplicate and deleting it afterwards.
     
    If you really want to prevent that it is being created I would suggest to handle the input side of things (in other words the form). In that case a Power Apps app would be a way of dealing with this requirement. In that product you can validate the input before actually are creating the item.
     
    However, if you still want to delete duplicates afterwards you could use a Filter Query in a Get Items for that in a Power Automate cloud flow.
     
    Below is an example of that approach.
     
    1. The below is used for the Filter query of the Get Items. It checks that other items don't have the same ID and if the other fields are the same. 
     
    (ID ne @{triggerOutputs()?['body/ID']}) and (BikeName eq '@{triggerBody()?['BikeName']}') and (BookingDate eq '@{triggerBody()?['BookingDate']}') and (BookingStartTime eq '@{triggerBody()?['BookingStartTime']}')
     
    2. In the condition a check is done if any duplicates are found
    length(outputs('Get_items')?['body/value'])
    3. If that is the case, the newly created is deleted. Make sure you select the correct ID from the trigger action.
     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1