I have an app that is used to schedule healthcare appointments. All appointments that are available to be booked are called "open slots". I get all the open slots and store them into a collection. The columns in this collection are appointment type, date, duration, start time, location, and provider type (MD, ANRP, RN, etc....).
There is certain criteria where a patient needs to be scheduled for back to back appointments. For that case, I have two galleries. Gallery A is showing the Open Slots collection. Gallery B shows a filtered open slots collection but it will only show the open slots where the time is directly after the first open slot selected and at the same location.
For example: If I select the open slot for Tuesday, 3/22/2022 at 10:00AM (20 minutes in duration) in Gallery A, then I only want to show open slots for Tuesday 3/22/2022 at 10:20AM (20 minutes in duration) open slot in Gallery B. I have this portion working correctly.
The area I am having trouble with is Gallery A shows all open slots. I would like to filter out open slots in Gallery A where there is not an open slot available directly after.
Any ideas on how I can filter Gallery A to not show open slots that don't have an open slot after it?
I thought about adding a column to the Open Slots collection to indicate if there was an open slot directly after it. If so, then the column value would be true, if not, then false. Then I could display all Open Slots where the new column value is true. Not quite sure how to do that though. Any help or ideas would be greatly appreciated. Thanks.

Report
All responses (
Answers (