Skip to main content

Find Resource Blocks Action

The Find Resource Blocks action searches for resource blocks (user events with event_id set to blocked_dates) that match specified criteria.

Jerome Bajou avatar
Written by Jerome Bajou
Updated this week

Overview

The Find Resource Blocks action searches for resource blocks (user events with event_id set to blocked_dates) that match specified criteria. Use this to discover existing blocks, filter by date ranges, or find blocks for specific resources.


Configuration

Filters (Optional)

Apply filters to narrow down the search results. Filters can be applied to any field in the user event context:

  • id - User event ID

  • user_id - ID of the user who owns the block

  • event_id - Event ID (will always be blocked_dates for blocks)

  • summary - Summary text of the block

  • start - Start date and time (ISO8601 format)

  • end - End date and time (ISO8601 format)

  • bookable_type - Type of schedule (if block is for a specific schedule)

  • bookable_id - ID of the schedule (if block is for a specific schedule)

  • calendar_id - Google Calendar ID (if synced)

  • created_at - Creation timestamp

  • updated_at - Last update timestamp

Filter Examples:

Filter by start date after a specific date: 
- Attribute: start
- Condition: greater_than
- Value: 2024-01-15T00:00:00Z

Filter by user ID:
- Attribute: user_id
- Condition: equals
- Value: {user.id}

Filter by date range:
- Group: AND
- Filter: start >= 2024-01-01T00:00:00Z
- Filter: end <= 2024-12-31T23:59:59Z

Limit (Optional)

Maximum number of resource blocks to return. Defaults to 100 if not specified. Supports variables.

Example:

100

or

{limit_variable}

Output

Returns a collection of resource blocks in the workflow context:

{resource_blocks[0].id} 
{resource_blocks[0].user_id}
{resource_blocks[0].summary}
{resource_blocks[0].start}
{resource_blocks[0].end}
{resource_blocks[0].bookable_type}
{resource_blocks[0].bookable_id}

Accessing Resource Block Data

After this action, you can access:

{resource_blocks[*].id} 
{resource_blocks[*].user_id}
{resource_blocks[*].summary}
{resource_blocks[*].start}
{resource_blocks[*].end}
{resource_blocks[*].bookable_type}
{resource_blocks[*].bookable_id}
{resource_blocks[*].calendar_id}
{resource_blocks[*].created_at}
{resource_blocks[*].updated_at}

Examples

1. Find All Blocks (Limited to 100)

Limit: 100

Returns up to 100 resource blocks from users in the same business unit.

2. Find Blocks for a Specific User

Filters:
- Attribute: user_id
Condition: equals
Value: {user.id} Limit: 50

Finds up to 50 blocks for a specific user.

3. Find Blocks in a Date Range

Filters:
- Type: group
Operator: AND
Filters:
- Attribute: start
Condition: greater_than_or_equal
Value: 2024-01-01T00:00:00Z
- Attribute: end
Condition: less_than_or_equal
Value: 2024-12-31T23:59:59Z
Limit: 200

Finds all blocks that overlap with the specified date range.

4. Find Blocks for a Specific Schedule

Filters:
- Attribute: bookable_id
Condition: equals
Value: {schedule.id}
Limit: 100

Finds blocks that are specific to a particular schedule (product option).

5. Find Blocks with Summary Matching Pattern

Filters:
- Attribute: summary
Condition: contains
Value: Maintenance
Limit: 50

Finds blocks with "Maintenance" in the summary text.


Validation

The action validates:

  • Filters structure (if provided) - must be a valid array

  • Limit (if provided) - must be a number or variable

  • All filters must have required attributes and conditions


Best Practices

  1. Use filters - Always apply filters to narrow results and improve performance

  2. Set appropriate limits - Use reasonable limits to avoid processing too many results

  3. Filter by date ranges - Use start/end date filters to find blocks in specific time periods

  4. Business unit scoping - Remember that results are automatically scoped to your workflow's business unit

  5. Iterate carefully - When processing results, use loops to handle multiple blocks

  6. Combine with other actions - Use Get Resource Block to fetch details of specific blocks found


Related Documentation

Did this answer your question?