Dynamic resource selection with placeholders

Modified on Wed, 6 May at 7:10 AM

Dynamic resource selection with placeholders

Dynamic resource selection lets you control which calendar resources are bookable based on customer choices, lead data, or business logic — using placeholder expressions and @if conditions instead of a fixed resource list.

TL;DR

Access: Edit booking form → Bookable resources section → "Or, enter bookable resources using placeholders". Enter an expression that evaluates to: resource IDs (comma-separated), resource names, email addresses, resource tag names, or default (fall back to static selection). Use @if(@select[field,slug] == value){Tag Name}@else{default}@endif for conditional routing. Empty result = no resources bookable (blocks booking). Always include a fallback to prevent accidental lockout.

4 things to know

1

What the expression can return

The placeholder expression must evaluate to one of: comma-separated resource IDs (1, 2, 3), resource emails (["john@example.com"]), resource names (John Smith, Sarah Johnson), resource tag names (Installation Team - North), the word default (use static dropdown), or empty (no resources → blocks booking). The expression overrides the static dropdown selection.

2

Department/service routing with @if

Route customers to the right resource team based on their form selection: @if(@select[department,slug] == north){Installation Team - North}@endif @if(@select[department,slug] == south){Installation Team - South}@endif. Or service-type specific: @if(@select[service_type,slug] == premium){John Smith}@else{default}@endif. Always include @else{default} so unmatched cases still show valid resources.

3

Finding resource tag names

Go to Calendar → Calendar settings → Teams and tags → Resource tags to see all tag names. Or use the hh-data.calendar-resource-groups component to retrieve them programmatically: <hh-data.calendar-resource-groups pluck="name,id"/>. Tag names are case-sensitive in expressions — copy exact spelling from the UI.

4

Combined with transit profiles

Dynamic resource selection and transit profiles work independently and complement each other: dynamic selection controls which resources are eligible, transit profiles control how far those resources can travel. Use both together for precise availability: select the right team, then let transit rules filter by travel distance. Test after configuration — if no times show, the combination of rules may be too restrictive.

Read more

Conditional routing examples

Department-based routing — one resource tag per region:

@if(@select[department,slug] == north){Installation Team - North}@endif
@if(@select[department,slug] == south){Installation Team - South}@endif
@if(@select[department,slug] == east){Installation Team - East}@endif

Service-type routing with named resources and default fallback:

@if(@select[service_type,slug] == premium){John Smith, Sarah Johnson}@endif
@if(@select[service_type,slug] == commercial){Mike Davis}@endif
@if(@select[service_type,slug] == standard){default}@endif

@if/@elseif/@else with guaranteed fallback — always include @else to avoid empty results:

@if(@select[department,slug] == team_a){Team A}
@elseif(@select[department,slug] == team_b){Team B}
@else{default}@endif

Routing from a lead custom field (field value must match the tag name exactly):

@if(%lead_customer_type% == business){Commercial Team}@else{Residential Team}@endif

Advanced patterns

Multi-condition with AND (&&) — combine two form fields:

@if(@select[location,slug] == north && @select[service,slug] == installation){Installation - North}@endif
@if(@select[location,slug] == north && @select[service,slug] == service){Service - North}@endif
@if(@select[location,slug] == south && @select[service,slug] == installation){Installation - South}@endif

Blocking bookings conditionally — return an empty result to prevent booking:

@if(%lead_approved% == false){}@else{default}@endif

Useful for blocking bookings for unapproved leads, inactive accounts, or out-of-area customers. No times will be shown if the expression evaluates to empty.

Troubleshooting

No available times showing

  • Temporarily replace expression with default to verify the static resources work
  • Check expression evaluates to valid resource IDs, names, or tag names
  • Verify resources exist and are active in Calendar settings
  • Check browser console for syntax errors

Wrong resources are showing

  • Verify field slugs in @select[field,slug] match exactly — both field name and attribute required
  • Resource tag names are case-sensitive — copy exact spelling from Calendar settings
  • Test each condition branch individually to isolate the issue

Expression not evaluating / syntax not recognized

  • Ensure correct syntax: @select[field,slug] — not @select[field]
  • Simplify the expression to one condition and expand from there
  • Check for missing closing @endif

Fallback to "default" not showing expected resources

  • Confirm resources are selected in the static "Bookable resources" dropdown
  • Verify the word default is lowercase and spelled correctly
  • Ensure the expression reaches the @else{default} branch — add a test with no conditions to confirm

Common searches

dynamic resource selection • conditional resources • resource routing • placeholder booking form • resource tag • @if resources • department routing

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article