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 Apps / Stop Double Booking on...
Power Apps
Suggested Answer

Stop Double Booking on SharePoint Online List

(1) 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 Apps?
 
I have the same question (0)
  • Suggested answer
    vipuljain03 Profile Picture
    665 Super User 2025 Season 2 on at
    To prevent/stop double booking from your Power Apps form, you can implement a validation check before submitting the form.
    Let's say, you have a Dropdown for BikeName, Date Picker for BookingDate, and a Time Picker for BookingStartTime. You will have a Button to submit the form.
     
    On the OnSelect property of the button, add the below code:
    If(
        CountRows(
            Filter(
                BikeBook, 
                BikeName = DropdownBikeName.Selected.Value && 
                BookingDate = DatePickerBookingDate.SelectedDate && 
                BookingStartTime = TimePickerBookingStartTime.SelectedTime
            )
        ) > 0,
        Notify("This bike is already booked for the selected time and date.", NotificationType.Error),
        SubmitForm(BookingForm)
    )
     
    Optionally, you can also disable the Submit button if conflict is detected. This ensures that the submit button is only enabled when there is no conflict.
    On the DisplayMode property of the button, you can add below code:
     
    If(
        CountRows(
            Filter(
                BikeBook, 
                BikeName = DropdownBikeName.Selected.Value && 
                BookingDate = DatePickerBookingDate.SelectedDate && 
                BookingStartTime = TimePickerBookingStartTime.SelectedTime
            )
        ) > 0,
        DisplayMode.Disabled, 
        DisplayMode.Edit
    )
     
    -------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
    Thanks,
    Vipul

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 740 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 342 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard