Book your meeting room in Coda

Selecting only from available slots

Christiaan Huizer
6 min readMar 5, 2024

--

In my previous blog on booking a hotel room, I introduced a shortcut in my calculation applying the check out and check in logic. The assumptions are as simple as true. There is always a night between checking in and checking out and you check out before somebody new checks in for the same room. Both valid assumptions permit for a rather concise code snippet inside the relations (via options) and result in valid slots only.

Booking a meeting room is different. You can have a meeting from 09h00 — 10h00 and a next one from 11h — 12h00, but you can also have a meeting between 10h00 and 11h00. In short, we can have multiple (consecutive) slots per day and that for every day of the week. On top, we allow to make a reservation spanning multiple days. The solution should enable the user to book meeting rooms effortlessly without worrying about limited availability or double bookings. Additional features like emailing invited people, room analytics etc. I did not (yet) include in this set up. These extras are actually unrelated to the core problem: the calculation to avoid double bookings and thus only provide valid time slots per room.

This is a difficult puzzle to solve. After reading this blog you understand filtering better and with some perseverance you maybe can create your own booking system in Coda. I explain important basics, but not all in detail, so there is some work left for you. Building a functional Coda doc is a reward, not a gift.

The Max Method

We apply a variation of the Max method , since it permits to evaluate lists by looping through a list of numbers using logical operators. Dates and time are numbers, meaning that we can loop through and check if they are greater than, smaller than or equal to another number.

The Max Method logic permits to create pairs. We take per room the start & end date (times), we turn them into a list, apply sorting and we evaluate each date using the SwitchIf().

step 01 — creating pairs

This logic will also work if the renting of a room (or anything else) will span multiple days. This applies for example when you want to rent a car.

The data set we work with you find below and as you can see, the Max Method helps us to link start & end times, including the days between start & end times you can spot by their 00:00 values.

the data set we work with

Filtering on relevant pairs

The pairs we got do not tell us which pair covers a time frame the rooms are free or occupied. We have to filter out the time slots for rooms in use. It took me a while before I noticed the pattern, but once you see it, the logic is a kind of nice.

We count the pairs, we evaluate each pair on the first & last part and check if it fits the list of reservations. If not, we take the values and generate a pair.

list of open periods

Below you see how we compare the list of all pairs to the list of open periods:

visual comparison

The list of pairs is however not yet complete. We need to check before and after the first and the last period and take care of special situations. We look at the max value and take all dates after to get the range of free dates, likewise via the min or first value of the start date.

complement the lists with open values

Filtering the relations

The last part of this exercise is to relate these open slots to the relations we use to define start & end values. This is the part you have to figure out on your own. As you may understand, it is a filter inside the relations you access via options.

Good luck!

Paid template

May you not be in the position to create this solution (you basically need to type it over to make it work), but you need something like this, you can check this paid template. It is an expensive template even to the extend that you may want to integrate other software instead of using this Coda template. I found this site offering you quite some interesting options.

These applications have plenty of advantages, but of course your data is not in one place, unless you can bring in this data inside Coda via a webhook or a pack (which can be costly as well). Having all your important organizational data living in one system is a great advantage, but it comes with an investment in set up and maintenance. Nothing is for free.

Coda integrations

On top of the complex calculation I shared, you can can create a form that allows for people to book a room. You can set up a scenario in which the moment a new row is generated an email goes out to all participants. In the confirmation email you add a link to cancel the room reservation. It is again a form, pre filled with some basics and the moment you cancel, an email goes out to all with the message of your choice and the slot is removed from the reservation table. The calculation adapts for the new values and off you go. No manual work, everything is Coda based, we use the Gmail pack for the emails.

This set up with emails etc. is not difficult, but it is time consuming. This is the work I do for and with clients and will take a couple of hours (4 or more, depending on your feedback and requirements). Again, make your business case and ask yourself if it is worthwhile the investment.

Possible next steps — resource planning

Adding smart actions to a calculation results in a work flow. You book a meeting room or rent a bike, you get the confirmation, your account (with credits) is updated etc. What if you have to plan for bigger events? What if you need rooms for 40 people and thus multiple rooms during a longer period? You can check for multiple rooms one by one, using a calendar view for visual support. This is getting difficult when you have 40 bikes and you need to serve a group of 12 people for one hour. Here we need calculations. Maybe I’ll pick up on this later this spring.

For now I wish you the best of luck in setting up your own reservation system, you got 90% of the calculations already for free.

I hope this article was informative and helpful. Did it help you to solve a problem you unlike would have solved other ways? What about a donation?

My name is Christiaan, and I regularly blog about Coda. While this article is free, my professional services (including consultations) are not, but I’m always happy to chat and explore potential solutions. You can find my free contributions in the Coda Community and on X. The Coda Community is a fantastic resource for free insights, especially when you share a sample doc.

--

--

Christiaan Huizer
Christiaan Huizer

Written by Christiaan Huizer

I write about how to Coda . You find blogs for beginners and experienced makers. I publish about 1 / week. Welcome!

No responses yet