I really tried to do it by myself, but I am stuck here. I am building a futsal sessions reservation mobile app on bubble. For a brief description :
2 games modes are available : first requires 10 people to choose an hour on the calendar, second require 15 people to choose an hour on the calendar.
I already managed the workflow so that when you change game mode 1 or 2, calendar will display proposition from current user and others on that game mode only (so there are 2 calendars display)
My goal is is to create a data that will count how many users have “proposed” the same date and hour. For example, if 5 people click on “8th augustus at 3pm”, I want the current event to display this number (5) and that it incrementes until the 10 people have chosen the same date and hour.
I want to do this so that I can create an event when 10 people have chosen the same date/hour and thus automaticly generate a “session confirmation”
The only result I managed to get for the moment is a line on my database at “proposition_counts” that incrementes +1 but for every event on the calendar… So basically, everytime a user clicks it will go +1 which is not the goal…
What I need is that for a particular event (8th augustus at 3pm for example) I get the count of how many people clicked that option
Thank you very much to all for reading me and taking time to help, Im new on bubble no code app but I love it a lot
EDIT : I managed to find the way to display how many users chose the same date/hour on the same current cell. Problem is it creates another event each time inside this same cell… my goal is when users choose the same date/hour, the event is only “updated” on the display for how many users chose this date/hour
Instead of incrementing a number such as proposition_count, add a list of users to the proposition and add the clicking user to that list of the proposition. So that there will be unique entries (i.e., a user can’t be added more than one, no matter how many times it is clicked). Then, you count this field.
Whether you keep counting clicks or go the way @hergin suggests depends on how your DB is structured. Both options are valid.
To answer your original question you keep adding 1 to the count. Add conditional to the workflow or action only when total count < 10. When count is >=10 display the popup saying the event is full or just disable the button completely.
NOTE:
Don’t forget to allow users to cancel their reservation.
You need to connect Events & Users/Accounts in the DB so that 1 User/Account can only registers once to each event.
Hope this is helpful. Share more details if you get stuck.
Hey @hergin and @bestbubbledev !
You guys are amazing ! Thank you for such fast answers
I tried Hergin’s method and… it works !!!
I had to adapt the DB, and other few details for it to work correctly (user cannot choose same date/hour twice, but can cancel his proposition without deleting the current event if other users clicked it)
There is now one detail that bothers me : You can see on the screenshot below that every current event displays " 12AM " even though it’s not the chosen hour, when I view the calendar in week/day view, all the events are put on “12AM” period… but in the database, “proposition” hours are correctly handled and users are correctly added to the same “date/hour” (useful info : on DB, the cell “Date” display the correct date, but is somehow stuck on “12AM” and I don’t find the way to delete this) => on DB, the hour chosen by users are correctly handled, as well as added users
What did I do wrong for the calendar to display “12AM” followed by the number of added users? I would like to only display the added users, and if possible instead of “12AM”, I want to display the “current hours” chosen
But in all cases, I appreciate your help soooo much, if only you’d know how hard I was struggling on this ahah
to make it clear “group date” is the container where people click “propose” and the current event updates itself, there are hours (Data type = HeureOption set => OS_Hours = 01:00, 02:00, 03:00 etc…)
So here we can see " Date = Group Date’s date" , I think you’re right and the problem sit here but I can’t figure it out… I’ve tried " Date = Calendar’s current event’s date " or “Calendar’s current day’s event’s date” , not successful and create bad behaviours…
I think you can still get Group date's date but add Current Cell's OS hours to it to change the hour portion. Since group date’s date shows the beginning of the day, when you add, it will show the correct time.
Hey @hergin , I have been trying this since this morning but impossible to add Current Cell’s OS hours to Group date’s date
I will keep trying combinaisons, I also required bubble product support for help… This is the last thing on the calendar that keeps me from going forward
If you have other suggestions please don’t hesitate, you have been very helpful and for this I can’t thank you enough
You will just use the +hours operator. See an example below:
Yours will look like: Group Date's date+ hours: Current Cell's OS_hours (if Current Cell's OS_hours is text, then you will also need to convert it to number like this: Group Date's date+ hours: Current Cell's OS_hours:converted to number)
I tried "Group Date’s date +hours: Current cell’s OS_hours’s display converted to number but when I do it, propositions don’t register into the calendar on click
precision : OS_Hours is an “option sets” with hours options such as " 01:00 , 02:00, 03:00 , 04:00 " etc…
You can add a number attribute to the option set. An attribute is like an addition on top of Display to each option set. In this number attribute, you assign the numeric value of each hour like 13:00 will be 13. And when you are doing the thhing in the picture you sent, you select that attribute (which will show on top or bottom of Display).
See some pictures on how to add/set/use an attribute below: