# How do I filter resources or options in booking forms?

URL: https://help.hubhus.com/kb/how-do-i-filter-resources-or-options-in-booking-forms
Category: Calendar and booking / Booking forms
Updated: 2026-09-28T14:40:34.168+00:00

Summary: For most cases: select specific resources in the booking form settings ( Resources / Who ). For region/skill routing: use separate forms per segment. For dynamic filtering: use bookingForm.setCalendarResources(&#91;id1, id2&#93;) in JS, or append ?calendar_resources=id1,id2 to the form URL.

Not every form should show every resource. You can limit which technicians, teams, or assets are bookable - by static selection, geographic rules, or dynamically via JavaScript or URL parameters. This is how you make sure the right resource gets booked every time.

## 4 ways to filter resources

1. **Static selection (most common).** In the booking form under **Resources / Who**, choose exactly which calendar resources are allowed. Decide if customers can pick a resource, or if Hubhus auto-assigns. This covers the majority of use cases.
2. **Tag-based routing (recommended for scaling).** Use resource tags (region, skill, team) and create separate booking forms per segment. Example: "Form - Region West" selects only Region West resources. Keeps each form simple and avoids complex conditional logic.
3. **Location/transit rules.** In the form's **Location & transport** settings, configure bookable postal codes, max driving from base, and max driving between events. Resources outside the customer's area are automatically excluded - no manual filtering needed.
4. **Dynamic JS or URL override (advanced).** Use `bookingForm.setCalendarResources([{id: 534, weight: 30}, {id: 552}])` in the form's JavaScript, or append `?calendar_resources=534,552` to the URL. IDs must be a subset of those already selected in the form settings.

**Default:** Static selection in form settings · **Scaling:** Separate form per region/skill · **Dynamic:** JS or URL param

**Read more**

### Weights and prioritization

When multiple resources are available, Hubhus selects based on: `totalWeight = resourceWeight - transitMinutes`

A higher resource weight makes that resource more likely to be chosen - even if transit is slightly longer. Useful to prefer specific team members or deprioritize backup resources.

Set weight in JS: `bookingForm.setCalendarResources([{id: 534, weight: 30}])`. Get current resources and adjust: `var r = bookingForm.getCalendarResources(); r[0].weight = 30; bookingForm.setCalendarResources(r);`

### Debugging resource selection

Two placeholders help verify which resources are active during testing:

- `%calendar_resources_as_pretty_json%` - all statically defined resources and their IDs
- `%booking_bookable_resources_as_pretty_json%` - resources currently in use (after JS/URL filters). Place in Part 3 while testing, remove before going live.

### Form messages for filtered/blocked bookings

When filtering excludes a customer's address, configure clear **Form messages** so customers understand why:

- Unsupported postal code
- Address too far away
- No available times in the allowed date window

## Related articles

- https://help.hubhus.com/kb/creating-and-managing-booking-forms
- https://help.hubhus.com/kb/understanding-resources-and-availability
- https://help.hubhus.com/kb/dynamic-resource-selection-with-placeholders
- https://help.hubhus.com/kb/how-do-i-configure-booking-duration-and-time-restrictions
- https://help.hubhus.com/kb/randomizing-resource-weights-in-booking-forms
- https://help.hubhus.com/kb/booking-form-shows-no-available-time-slots
