web
You’re offline. This is a read only version of the page.
close
Skip to main content
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?
I have the same question (0)
  • 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,372 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 797 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 483 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard