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:

2 Likes

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…

Hi gf_wolfer,
First of all thank you for all your help and input on this subject!

I tried to follow every step as you showed and explained (basically copied it), but the part of finding ‘who’s available’ by getting available times didn’t seem to work for me,
I think I didn’t follow step number 4 correctly…
I followed all the instructions as much as I could (showing in the pictures)


When I press my ‘run’ button (to find “who’s available”) - it only populates one user -
but that user is not really available (already has bookings at that time)

If I do this (in the picture below) it populates a list of all the users - but still it doesn’t show them by availability (meaning users that show up as a result - are not really available at that time)
9.2

This is what I did for step 4 (my BookingStartDate and BookingEndDate are both dates, that are saved as part of my TopScheduleBookings database (created when someone creates a booking)




*You said in step 4 to filter for the specific day that I’m looking for - I’m not really sure on how to filter for the specific day…

I tried to do the booking ranges as well (in the picture below) - but that doesn’t seem to work either…


*it still gives me a result of one user - that isn’t really available at that time

I’m getting these 4 errors from the plugin


Could you tell me what am I doing wrong here please?

Can you send me a DM with the following info and I can jump in and troubleshoot:

  1. The Editor link - please make the Editor Public - anyone can edit

  2. The User Account email I should be Logged in as if applicable

  3. The Test Page to view and test this on, ie the URL with the Data included in the URL if it is a page with a Data Type

  4. Instructions where to click to test this specific issue (I don’t want o have to learn the whole app, just get me to the booking/testing part)

This topic was automatically closed after 70 days. New replies are no longer allowed.