Dynamic resource selection with placeholders
Learn how to dynamically control which resources are bookable in a booking form using placeholders and conditional logic. This powerful feature allows you to show different resources based on customer choices, lead data, or any custom criteria.
On this page
- Dynamic resource selection with placeholders
What is dynamic resource selection?
Dynamic resource selection allows you to control which calendar resources are bookable using placeholder expressions instead of static selections. This means you can show different resources based on:
- Customer selections – Different services, departments, or options in the booking form
- Lead data – Customer type, location, tags, or custom fields
- Business logic – Resource capacity, availability, specialization, or any custom criteria
Instead of creating multiple booking forms for different scenarios, you can use one form with dynamic resource selection to handle all cases.
When to use dynamic resource selection
Service-specific resources
Only certain team members can handle specific services (e.g., "Premium installations can only be handled by certified installers").
Department or location routing
Route customers to the right team based on their location or department selection (e.g., "North region customers → North team").
Customer type differentiation
Show different resources for business vs. residential customers (e.g., "Commercial installations → Commercial team").
Capacity-based filtering
Exclude resources that are at capacity or unavailable based on custom logic (e.g., "Skip resources with more than 5 events today").
Complex business rules
Any scenario where bookable resources depend on multiple conditions that can be evaluated programmatically.
How to configure dynamic resource selection
To set up dynamic resource selection in a booking form:
- Open the booking form you want to configure
- Navigate to the Bookable resources section
- Find "Or, enter bookable resources using placeholders:"
- Enter your placeholder expression in the text field
- Save the booking form
Note: Dynamic resource selection works independently from static resource selection. If you enter a placeholder expression, it will override the static "Bookable resources" dropdown selection when the form is used.
Placeholder expression formats
The placeholder field accepts several formats for specifying resources:
Resource IDs, names, or emails
You can specify resources using their IDs, names, or email addresses:
1, 2, 3
["john@example.com", "sarah@example.com"]
John Smith, Sarah Johnson, Mike Davis
Resource tag names
You can reference resource tags (groups) by their name:
Installation Team - North
Team A, Team B
Fallback to default
Use the string "default" to fall back to the resources selected in the static dropdown:
default
No bookable resources
Return an empty string to make no resources bookable:
This can be useful for blocking bookings under certain conditions.
Using conditional logic
The most powerful use of dynamic resource selection is combining it with @if/@else conditional logic to show different resources based on conditions.
Example: Department-based routing
Show different resource teams based on a department selection in the booking form:
@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}@endifHow it works:
- Customer selects a department in the
departmentfield - System evaluates which condition matches
- Shows the corresponding resource tag (e.g., "Installation Team - North")
- Only resources in that tag are bookable
Example: Service-specific resources
Show specific resources for specialized services:
@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}@endifResult: Premium services only show John Smith and Sarah Johnson, commercial services show Mike Davis, and standard services show all default resources.
Example: Customer type filtering
Route based on custom lead fields:
@if(%lead_customer_type% == business){Commercial Team}@else{Residential Team}@endifFinding resource IDs and tag names
To use dynamic resource selection, you need to know the IDs, names, or tag names of your resources.
Method 1: Via Calendar Settings (UI)
- Navigate to Calendar → Calendar settings → Teams and tags
- Click Resource tags
- View all your resource tag names (e.g., "Installation Team - North", "Service Team - South")
- Use these names directly in your placeholder expressions
Method 2: Programmatically (for developers)
Use the <hh-data.calendar-resource-groups> component to retrieve resource tags programmatically:
<hh-data.calendar-resource-groups pluck="name,id"/>
Output example:
{
"176": "Installation Team",
"177": "Installation Team - North",
"178": "Installation Team - South",
"179": "Service Team - East",
"485": "Service Team - West"
}This JSON output shows all resource tag IDs and their names, which you can use in your expressions.
Advanced use cases
Combining multiple conditions
Use nested or sequential conditions to handle complex scenarios:
@if(@select[location,slug] == north && @select[service,slug] == installation){Installation - North}@endif
@if(@select[location,slug] == north && @select[service,slug] == service){Service - North}@endifBlocking bookings conditionally
Return an empty string to prevent bookings under certain conditions:
@if(%lead_approved% == false){}@else{default}@endifThis blocks bookings for unapproved leads.
Using any placeholder or expression
You can use any placeholder or expression that evaluates to resource identifiers, including:
- Lead custom fields:
%lead_custom_field% - Booking form fields:
@select[field,slug],@input[field] - Lead properties:
%lead_tags%,%lead_campaign_id% - Custom logic: Calculations, comparisons, string operations
Relationship with other booking form settings
Static resource selection (dropdown)
The static "Bookable resources" dropdown serves as a fallback when dynamic selection is not used or when the expression returns "default".
Resource profile (transit criteria)
Resource profiles and dynamic resource selection are independent features:
- Resource profile – Controls driving criteria and transit rules (how far resources can travel)
- Dynamic resource selection – Controls which resources are bookable
Both settings work together: transit profiles filter resources by travel time, while dynamic selection filters by business logic.
Best practices
Start simple
Begin with basic conditions and test thoroughly before adding complex logic. Use one booking form to verify expressions work as expected.
Use descriptive tag names
Name your resource tags clearly (e.g., "Installation - North Region" instead of "Team A") so expressions are easy to read and maintain.
Always include a fallback
Ensure your logic always returns valid resources or "default". Avoid scenarios where the expression returns nothing unintentionally, as this would prevent all bookings.
@if(@select[department,slug] == team_a){Team A}
@elseif(@select[department,slug] == team_b){Team B}
@else{default}@endifTest with real scenarios
Test your dynamic resource selection with real customer data and selections to ensure it behaves as expected across all use cases.
Document your logic
Keep notes on what each expression does, especially for complex forms with multiple conditions. This helps when troubleshooting or updating the form later.
Consolidate forms when possible
Instead of maintaining separate booking forms for different departments or services, use one form with dynamic resource selection to reduce maintenance overhead.
Troubleshooting
No available times showing
If customers don't see any available times:
- Check that your expression returns valid resource IDs, names, or tag names
- Verify the resources exist and are active in Calendar settings
- Test the expression by temporarily using
defaultto see if static resources work - Check browser console for errors or invalid syntax
Wrong resources are showing
If incorrect resources appear:
- Verify the field names in your
@selector@inputreferences match exactly - Check that resource tag names are spelled correctly (case-sensitive)
- Ensure your conditional logic covers all expected scenarios
- Test each condition individually to isolate issues
Expression not evaluating
If the expression doesn't seem to work:
- Ensure you're using correct placeholder syntax (e.g.,
@select[field,slug]not@select[field]) - Check for typos in field slugs or resource names
- Verify the field exists and has a value when the booking form loads
- Try simplifying the expression to identify syntax errors
Fallback not working
If "default" doesn't show expected resources:
- Verify you have resources selected in the static "Bookable resources" dropdown
- Check that the word "default" is spelled correctly (lowercase)
- Ensure the expression actually reaches the "default" return path
? Common searches
dynamic resource selection • conditional resource booking • placeholder booking forms • resource filtering by selection • booking form conditional logic
? Also known as
conditional resources • smart resource assignment • dynamic booking • resource routing • context-based availability
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