I do this sort of thing quite often… the issue is, it is hard to describe what you need to do.
You have a list of Technicians, each of whom has a list of “booked dates” on them. You have a user-defined range of times that the user would like to have a Technician come and “handle their business” (as it were).
You need to iterate over the list of Technicians, but also iterate over each technician’s list of booked dates.
Your dropdown is a list of “available technicians”.
An individual Technician is AVAILABLE if:
- There are no individual date/times for which the Technician is UNavailable within the user-selected range. In Bubble terms, this is:
Technician's Dates Unavailable:filtered (Advanced: User's range contains point This Date) is empty
You are constructing your user’s date range on-the-fly, so this becomes:
Technician's Dates Unavailable: filtered (Advanced: Parent group's schedule/event/appointment's Event End<-- range -->Parent group's schedule/event/appointment's Event Start contains point This Date) is empty
(And, at this point, we are re-thinking our field labels! But that’s cool.)
- But we do not have just one Technician. We have a list of Technicians. The list of ALL Technicians in the universe is:
Do a Search for… Technicians
- So, what we must do is :filter the list of all Technicians in the universe by the criteria #1. In Bubble terms this is:
Do a Search for… Technicians:filtered
- What’s the :filtered condition? The filter described in #1. So this becomes:
Do a Search for... Technicians:filtered (Advanced: This Technician's Dates Unavailable:filtered (Advanced: User's range contains point This Date) is empty)
Building this will pop up multiple Advanced filter dialogs. The way to build it is to create:
Do a Search for... Technicians:filtered
… first. THEN, click on that :filtered. Create the Advanced condition there.
… then, in the dialog for that Advanced condition, build:
This Technician's Dates Unavailable:filtered
… then drilldown on THAT :filtered. Create the second Advanced condition there:
Parent group's schedule/event/appointment's Event End<-- range -->Parent group's schedule/event/appointment's Event Start contains point This Date is empty
It’s entirely possible I’ve noted something wrong here as I’m just doing this off the top of my head. However, I think you see now how to think about this and construct it. You were just thinking “one level down”… you need to “pop up” a level and start with the list of all Technicians (Do a Search for… Technicians) and filter that.