Photo by Jens Kreuter on Unsplash

How to find a free room using Coda?

Date based filters combined with capacity

Christiaan Huizer
3 min readApr 7, 2022

--

In my previous blog I wrote about setting up a table with sample information. In this blog we explore how you can filter out dates that match the criteria and we show how to find a room that fits your single search criteria: people.

The Date Picker

We relate the date picker to the table view using the table option ‘Filter’. This gives us a quick overview of the rooms booked. We start with bringing in all the rooms. Instead of using currentvalue.IsNotBlank() we apply the column Name.

The why you see in the screenshot below. The CurrentValue is not blank, even when the eye tells you it is. This was a bit of a surprise to me.

The second step is to only show the rooms that are not in the list of Rooms Booked. Below how we can filter out using Contains() and Not()

Filter direct on a Filter

The same result using WithName() to improve the understanding of the formula.

Using WithName() to get the free rooms

With the available rooms in our view we can hide the booked ones and bring in related information like the capacity per room. In our third step we chain to get results.

step 03: chaining in action

Step number 4 is to check if we can find a room that fits the criteria of let’s say a room for 3 people. We get the results by combining a Filter() and a FormulaMap(). The Filter outputs the position of the free room in the list of Free Rooms and the FormulaMap() turns this position into a room.

Formula to find a fitting room

Here you have it: a formula that permits you to find an available room.

I am not an hospitality specialist, but from my own experiences I know that sometimes you are also happy with two rooms if you cannot find one room that fits all. This puzzle we try to solve in our next blog.

I hope you enjoyed this article. If you have questions feel free to reach out. Though this article is for free, my work (including advice) won’t be, but there is always room for a chat to see what can be done. Besides you find my (for free) contributions to the Coda Community and on Twitter

My name is Christiaan and I support SMB with calculations (budgets and planning) and I prefer using Coda to get the job done.

Not to forget: the Coda Community provides great insights for free once you add a sample doc. Paid consulting is often not the way to proceed.

Christiaan on: How to find a free room using Coda?

--

--

Christiaan Huizer

I write about Coda.io - AI and (HR )planning challenges. You find blogs for beginners and experienced makers. I publish about once per week. Welcome!