# Double booking check

**URL:** <https://community.glideapps.com/t/double-booking-check/69935>\
**Category:** Ask for Help\
**Created:** [January 24, 2024, 11:37am UTC](https://community.glideapps.com/t/double-booking-check/69935 "2024-01-24T11:37:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonne\_Paes](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jonne_paes/32/1162_2.png) [@Jonne\_Paes](https://community.glideapps.com/u/Jonne_Paes)\
**Post date:** [January 24, 2024, 11:37am UTC](https://community.glideapps.com/t/double-booking-check/69935/1 "2024-01-24T11:37:47Z")

</div>

Hi,

I am building an app to facilitating share a car with eachother and reserving the car.  
I have build an calendar assigned to a sheet where the user adds a reservation (one or multiple days with start date + time and end date + time). I am wondering if and how its possible to prevent double bookings. I have seen some solutions for time slots, but I want to make it impossible (or at least give a warning via hint-component) to book the car within another booking.

Is this possible? And how can I achieve it?

---

<div class="post-metadata">

**Author:** ![Lucas\_Malguy1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_malguy1/32/54607_2.png) [@Lucas\_Malguy1](https://community.glideapps.com/u/Lucas_Malguy1)\
**Post date:** [January 24, 2024, 2:04pm UTC](https://community.glideapps.com/t/double-booking-check/69935/2 "2024-01-24T14:04:14Z")

</div>

Hi @Jonne_Paes

Unfortunately there is no native way of blocking slots that are already taken in Glide.

Here is what I would try :

- Create a custom form for the booking process where user selects car, start and end date
- Do a query to the reservations table, filtering by : 1) the id of the selected car, 2) check if there are reservations starting before the selected end date OR 3) if there are reservations with and end date after the selected start date.
- Use an IF Then Else to block the submission of the form is there are results in the query

It might be tricky to play with comparing the dates but I think it could work.

The only thing is that it might make the user think the car is not available at all in the selected period. For ex, let’s say a user wants to book from 01/01/2024 to 02/01/2024. The car is available but someone has already a booking starting on the 01/31/2024, so before the selected end date of the user completing the form, so it’ll block the user from booking whereas the car was only unavailable 1 day in the requested booking window.

So if this works, it would be great after to find a way to retrieves start and end dates of the current bookings and display infos to the user so he can re ajust his booking.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [January 24, 2024, 2:47pm UTC](https://community.glideapps.com/t/double-booking-check/69935/3 "2024-01-24T14:47:35Z")

</div>

> [@mortar\_board Advanced Booking App Tutorial (Step-By-Step)](https://community.glideapps.com/t/advanced-booking-app-tutorial-step-by-step/66386):
>
> [[🎓 Glide Tutorial - Advanced Booking App (Full Course & Cheat Sheet)] ](https://www.youtube.com/watch?v=EBuTMEa_aFQ) What’s up Gliders! Thought I’d share my latest free tutorial for those that might be interested. popcorn 𝗔𝗯𝗼𝘂𝘁 𝗧𝗵𝗶𝘀 𝗧𝘂𝘁𝗼𝗿𝗶𝗮𝗹 popcorn This tutorial is an in-depth, step-by-step, tutorial that shows you how to build an advanced booking app from scratch in Glide. nerd_face 𝗦𝘁𝗮𝘆 𝗙𝗼𝗰𝘂𝘀𝗲𝗱 nerd_face Sprinkled throughout this tutorial are countless insider tips, strategies, code snippets and techniques that w…
