Randomizing Resource Weights in Booking Forms
Hubhus booking forms allow you to dynamically control which calendar resources are prioritized when suggesting available times.
On this page
Jump to any section using the links below
How to randomize resource weights in a booking form
Table of Contents
Hubhus booking forms allow you to dynamically control which calendar resources are prioritized when suggesting available times. One useful technique is to assign random weights to resources, so that no single user is consistently preferred. This can help distribute bookings more evenly or create fair rotation.
Recommended: inside an HTML component, which allows you to reuse the script across multiple booking forms.
Using an HTML component makes it easy to maintain and update the logic in one place and include it wherever needed.
Example: Assign random weights to all bookable resources
How it works
bookingForm.getCalendarResources()retrieves the resources selected in the formA random weight between 10 and 50 is generated
Higher weight = more likely to be selected
Weight is combined with transit minutes in Hubhus routing logic
Updated weights are applied with
setCalendarResources()
This runs once when the form loads, meaning each customer sees a slightly different priority order — ideal for fairness or ad-hoc load distribution.
When to use this
To avoid the same installer/technician being suggested every time
To randomize resource priority for equal-load teams
To distribute bookings when all resources are equally suitable
For A/B testing of routing behavior
? Common searches
booking setup • calendar setup • appointment scheduling • booking configuration
? Also known as
appointment • scheduling • reservation • calendar event
Related articles
How to add a button that pre-fills a meeting location in the booking form
Working with Data Fields in bookingforms (Advanced JSON Storage)
Creating and managing booking forms
How do I configure booking duration and time restrictions?
How do I configure booking form error and info messages?
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article