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:
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.
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.
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.