Forum Academy Marketplace Showcase Pricing Features

Searching for "who's available" (I'm using TopCal plugin)

Hi there,
I’m having trouble - got stuck… hopefully someone could help please???

So I’m creating a function in bookings
in that function there is a time and day that already been selected,
and I need to find “who’s available” for that date…
I’ve been using TopCal plugin for the bookings and scheduling,
but I’m stuck in doing this (searching for users that are available at the specific time and day…)
So let’s say for example: there’s a booking on April 27th at 9:15pm that needs to be “covered”
and I need to find a user that is available on that specific day and time…

I’m really stuck with this, anyone can help or has any idea where to go with this?
Thank you in advance!

Hey there.

There can be a couple different ways. Approximately how many Users will you be searching across for availability? (1-10, 10-100, thousands, etc)
Also, are the Users setting their availability using a Pattern, such as Mondays 9-5, or only with Specific Date Range Availability? (can help with some speed optimizations if the latter)

If it is a small number we can do some logic on page, if it is a large number and searching is a key function in the app then it may be more efficient to save available time slots directly on a User’s Schedule

Hi gf_wolfer and thank you for the reply,
It’s about 1 - 10 users, they are setting availability by pattern but, I’ve put in all the methods that were in the documentation, like specific days, blocking specific days, etc… (plus they will be having dates that are already booked as well)
My main reason for this function, is for example, there is a date that’s already got booked but the user doing the booking could not do it, so I’ll need to find someone else (another user) to book it with, so I want to create repeating group that will show me “who’s available” for that specific day and time…

Again thank you for your response!

@bizyland I don’t know why you are using the plugin but it can solve without a plugin too.

Store the user availability time in the table. For example- If the user ‘A’ have availability
Mon- 9:00AM - 5:00 PM
Tue- 9:00AM - 5:00 PM
Wed- 9:00AM - 5:00 PM
Thur- 9:00AM - 5:00 PM
Fri- 9:00AM - 5:00 PM
Sat- 9:00AM - 5:00 PM
Sun- 9:00AM - 5:00 PM

Considering there is a fixed event time for 30 min.

So when the user selects the date and time, find the what is the day for that day for ex- Monday, Tuesday etc.

and check which user is available ( you also need one more table to store booked slots too ) and show the user.

User is available - Is the time slot available in the User’s availability Table and the Time Slot not available in the user booked slot.

Got it, one way to do this is have a repeating group of those 1-10 users on page somewhere (tiny and behind other elements) with a Get Time Slots element in each row. Then using the Orchestra plugin you can run a workflow within each repeating group cell to check the Time Slots and only show Users in another repeating group whose Time Slots (with the date parameters) count is greater than 0.

There might also be a way without the Orchestra plugin and using Custom Event Loops and the TopCal Action GetAvailableTimes, but I haven’t fully tested that yet.

This can get a little in depth and confusing to build out, so if after trying some of the above you still need assistance let me know and I might be able to put together an example later this week.

1 Like

I really wish it was this easy (almost is in single time zone situations), would have saved me months of struggle and eventually building this plugin :sweat_smile:

Thank you very much!
I will give it a try and let you know if it worked (hopefully will be successful)

Hi there,
I’ve been trying to build what you wrote, but I’m not really knowledgeable on the Orchestra plugin, and I wasn’t sure on how to make the search by time slots…
I’m still pretty new at bubble…
would you maybe be able to create a demo of this please?
or maybe give me some more detailed steps on how to do this function?
I’m kinda stuck with this…

I can try and put together an example this week :call_me_hand:

1 Like

Thank you very much!

So here’s the breakdown of using the Orchestra Plugin with the TopCal plugin to get a list of Available Users:

  1. Put a Repeating Group on page to load all your Users who have a relevant schedule
    Within the Repeating Group add a GetAvailableTimes Element and a Musicians Element

- This repeating group can be tiny and put behind other elements so that it cannot be seen. But make sure it is visible on page load and set to Full List - as we need to load all the Data and Elements in the cells for this to work properly

  1. Add a Maestro Element somewhere on the page, not within the Repeating Group we just made

  2. Add an Initialize Musicians Workflow:

  3. Set the relevant Fields in the Get Available Times element (yours will be Between These Dates and filter for the specific day the person is searching for)

  4. Create a Custom State somewhere on page to be a List of Users - we will populate this State with Users who have available times from this Workflow. This is a workflow that will run within every Cell of your Users repeating group, and all it does is recognize if the GetAvailableTimes element has any times (availability), and if it does then it adds the User (schedule in my example) to the Custom State list

  5. Create a Button or Workflow to kick off the ‘Finding’ of available Users. In your scenario you mentioned a User may have no available times, so you could have a ‘Search for other Users’ button that kicks off this search

  6. You can now add a Repeating Group of User’s with the Data Source set to the State that we created above

1 Like

Good stuff Geoff!!!

1 Like

Thank you very much!
I will give it a go…