How to find a free room using Coda?
Date based filters combined with capacity
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
The same result using
WithName() to improve the understanding of the formula.
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 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.
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.