# Room booking app - can't filter for spaces without bookings

**URL:** <https://forum.adalo.com/t/room-booking-app-cant-filter-for-spaces-without-bookings/8456>\
**Category:** Get Help\
**Created:** [January 28, 2021, 12:16am UTC](https://forum.adalo.com/t/room-booking-app-cant-filter-for-spaces-without-bookings/8456 "2021-01-28T00:16:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ianstorrar](https://avatars.discourse-cdn.com/v4/letter/i/3be4f8/32.png) [@ianstorrar](https://forum.adalo.com/u/ianstorrar)\
**Post date:** [January 28, 2021, 12:16am UTC](https://forum.adalo.com/t/room-booking-app-cant-filter-for-spaces-without-bookings/8456/1 "2021-01-28T00:16:12Z")

</div>

I’m trying to build an app to allow people to book a room or space (e.g. a desk) for a meeting. The similar examples I’ve seen don’t seem to work for my needs - e.g. a class booking app works because a teacher sets office hours and then a student can book one of the sessions. I need a room to be available either 24 hours a day or between certain business hours (9-5 etc.). I’m not clear if I can do the kind of search logic needed here (spaces without bookings vs. unbooked sessions).

I’ve got collections for spaces/rooms and bookings with a relationship property between them:

 ![Screen Shot 2021-01-27 at 4.05.19 PM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/f/fc7a05c6899b4b82556a6d748acb6288826064c8.png)

When a user searchers for a space on a certain date/time, I want to have only spaces without bookings at that date/time to show up:

 ![Screen Shot 2021-01-27 at 4.03.27 PM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/c/cf03f2e3c86787033eaa90eed4fcdfb9ed063dfa.png)

I’m not seeing the options I need in the filters on the list of spaces:

 ![Screen Shot 2021-01-27 at 4.04.37 PM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/e/ef10af5958b67932ead60254e9221b4939b7d764.png)

I tried doing something to set the search value on the user record once they hit search:

 ![Screen Shot 2021-01-27 at 4.05.42 PM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/2/261a7611d3ca87f63f3c9d02bfb2d03f22da6894.png)

I was hoping that could then be used in the filter but that didn’t seem to work:

 ![Screen Shot 2021-01-27 at 4.03.58 PM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/2/22320ccccffad7d292a3b5893db87e4a34731ee8.png)

Any help is appreciated. Even advice on how to better ask this question or point out what’s not clear, would be amazing. 🙂

Ian

---

<div class="post-metadata">

**Author:** ![crmorris2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/crmorris2/32/5681_2.png) [@crmorris2](https://forum.adalo.com/u/crmorris2)\
**Post date:** [January 28, 2021, 1:04am UTC](https://forum.adalo.com/t/room-booking-app-cant-filter-for-spaces-without-bookings/8456/2 "2021-01-28T01:04:56Z")

</div>

Hi Ian,

I believe the only way you can achieve this is by having a list of available dates/times. From experience I don’t think Adalo has the ability to search through different times and calculate what times are available, yet.

If you did decide to create a collection where you can show a list of available room ‘slots’ then you could add a counter field (a numeric quantity field) to each ‘slot’ so when someone books the said ‘slot’, you can then add an action to -1 from the counter. You can then filter a list based on if the room has any slots greater than zero.

Hope this is a workaround you can work with, if not then sorry I couldnt be of more help.

Craig

---

<div class="post-metadata">

**Author:** ![ianstorrar](https://avatars.discourse-cdn.com/v4/letter/i/3be4f8/32.png) [@ianstorrar](https://forum.adalo.com/u/ianstorrar)\
**Post date:** [January 28, 2021, 1:25am UTC](https://forum.adalo.com/t/room-booking-app-cant-filter-for-spaces-without-bookings/8456/3 "2021-01-28T01:25:59Z")

</div>

Craig,

Thanks! I think you’re right and are confirming my suspicion. I can make that work. I was just hoping there was a more elegant, less data-intensive way to do this. I will need to work out a way to automatically generate the available slots and maybe delete unbooked slots as they “expire” if unbooked.

Best,

Ian

---

<div class="post-metadata">

**Author:** ![crmorris2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/crmorris2/32/5681_2.png) [@crmorris2](https://forum.adalo.com/u/crmorris2)\
**Post date:** [January 28, 2021, 9:38am UTC](https://forum.adalo.com/t/room-booking-app-cant-filter-for-spaces-without-bookings/8456/4 "2021-01-28T09:38:23Z")

</div>

One way of removing expired slots or create slots automatically on a daily basis is to use zapier. With zapier you can schedule actions for a certain time and date so you could set it up to delete expired slots at midnight and add new slots for the next day. I have never done this myself but I know it is possible and looks relatively easy.

Cheers  
Craig

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [February 7, 2021, 9:38am UTC](https://forum.adalo.com/t/room-booking-app-cant-filter-for-spaces-without-bookings/8456/5 "2021-02-07T09:38:52Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
