Reservation App - Data visualization

New on bubble.io
I’m trying to make a reservation app for a beach club.
I already have a database of reservation, with dates and reserved spot number.

I need to show those infos from db.
Every dot is a spot on the beach. When I select a specific day with date picker, I need every dot dynamic change its color: green if is free in the day I picked, red if not.

Hi there, @ben40… if I understand your post correctly, the data source of the repeating group(s) that shows the beach spots can’t be a search for reservations because you want to show all of the spots on each day, regardless of whether or not a spot is reserved on the selected day. So, while there are a number of ways to do what you have described with the colored dots, I think the first question is how are you defining the beach spots? I would probably use an option set, but there could be advantages to using a custom data type. Have you figured that out yet?

Best…
Mike


This is my db for reservation.

Cool, but that’s not necessarily what I was asking. You are focused on the reservation, but you should be starting with the beach spots. All of the reservable spots need to be defined somehow, and you could either use an option set or a custom data type to define them. Then, the spot field in your Reservation data type would be linked to that option set or custom data type.

Anyway, I don’t know exactly how new you are to Bubble, but if the stuff I am writing doesn’t make any sense at all, you should probably take a step back and go through Bubble’s tutorials or consider doing a boot camp because you are likely going to struggle without a good understanding of the basics.

very new indeed, hard studying since a week.

ok, so,
I made another db “AllSpot” to define spot, and linked the spot in “Reservation” db with the “#” in the AllSpot db.

Now I was able to change color if exist a reservation on that spot.
But it still don’t consider the days of reservation: how can I check the date?

A few things…

First, that’s not how you link data types. You should delete the existing spot field and create a new field that has a field type of AllSpot.

Second, if you have a check-in and check-out date for a reservation, you should consider using a date range field instead of two date fields.

Finally, you can check the date by adding constraints on the search for reservations where a selected date is greater than or equal to the check-in date but less than or equal to the check-out date (those being two separate constraints).

2 Likes

Ok, thanks for you help.
I figured out how to check for data range.
Now, if I select a range that overlap with a data already into the db the dots become red.

The problem is: if I have a reservation on spot 1 and another reservation on spot 2, if I select a range of date already reserved, they become both RED, not just the one reserved in those days .-.

I made a digram of the issue I need to solve


SOLVED, I had to put the two conditions in the same constrains :smiley:
Thanks again for your kind help