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

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
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?
Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,498 Most Valuable Professional on at
     
    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.
     
  • Vishwanth Profile Picture
    2 on at
     
    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. 

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 124 Super User 2026 Season 1

#2
Ellis Karim Profile Picture

Ellis Karim 52 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard