Good day fellow Bubblers
I am having a hard time wrapping my head around something and I think I’ve gone so far in one direction that I have blinded myself with what could be a much easier solution.
I’m trying to make a “self scheduling” system where I provide a list of time slots and the max capacity of each time slot.
Time slots are in 30 minute increments from 7AM to 10PM so there are 30 slots in a day
Each slot had it’s own MaxCapacity value which is the maximum number of allowed users in that slot. (Eventually when a user selects a group of slots the MaxCapacity value will -1 or I’ll generate another field and have it +1 and run a check if that field is = MaxCapacity)
I own a delivery platform and this is to allow my drivers to schedule themselves based upon availability.
My data type named TimeSlots has the following fields and field types
StartTime - TEXT
EndTime - TEXT
StartTimeDATE - DATE
EndTimeDATE - DATE
MaxCapacity - NUMBER
Day - TEXT
I have a GroupA across the top of the page that houses 7 more groups. GroupDay1, GroupDay2… and so on through GroupDay7
Each GroupDayX has a text field that displays the dates for the current and next 6 days. So GroupDay1 text element displays Current Date (Formatted) and GroupDay2 text element displays Current Date +1 (Formatted) all the way through to GroupDay7 text element displaying Current Date +6 (Formatted).
Below GroupA is another Group called ScheduleGroup. ScheduleGroup has a Custom State “SelectedDate” type “number”
When any of the 7 GroupDayX is selected it set the “SelectedDate” state to the Current date/times “+X” Extracted date. (It’s setting the state to the day value so it can match the data in the “Day” field on the TimeSlots data)
Now here is the part I’m needing help with. I add a Repeating Group into the ScheduleGroup and set it’s type of content to “TimeSlots” and the Data source to “Search for TimeSlots” with the following constraints
Day = ScheduleGroups SelectedDate (state)
MaxCapacity > 0
StartTimeDATE > Current date/time
I have 2 input elements in the repeating group that just have the initial content set to “Current Cells Index +1” or “Current Cells Index -1” and those inputs are named "Input+1 " and “Input-1”.
There are 2 Text Elements in the Repeating Group as well. One to display StartTime and another to display EndTime
The StartTime text elements value is “Current cell’s TimeSlots StartTime” and I have the condition When “Current cell’s TimeSlots’s StartTime is RepeatingGroup TimeSlots’s List of TimeSlotses:Item #Input -1’s value’s EndTime” then the element is not visible.
The EndTime text elements value is “Current cell’s Timeslots EndTime” and I have the condition When “Current cell’s TimeSlots’s EndTime is RepeatingGroup TimeSlots’s List of TimeSlotses:Item #Input +1’s value’s StartTime” then the element is not visible.
The issue I’m stuck on is how to take this and fix it to where the start time and end time show on the same row of the repeating group. As is the start time and end time will show on separate rows unless the start time and end time is the exact values of one 30 minute slot.
I’m thinking I need to either use one text element that contains start time and end time but how do I consolidate the list for each?
Or I need to consolidate the list into it’s own consolidated list before trying to display it. but again, I’m not sure how.
Any help would be appreciated.
Thanks