> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/calendar/filter-and-search-bookings.md).

# Filter and Search Bookings

Add a room filter and a subject search to a query-backed Avonni Calendar so coordinators can find a training booking in a busy schedule.

A coordinator needs to see which training bookings use Cedar Room, then find a safety session among those bookings. Add a room filter and a subject search to the Avonni Calendar timeline.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2F7qu8UnKTV3EZX3wSrmLz%2Fcalendar-filter-and-search-bookings-result.png?alt=media" alt="Calendar with Cedar Room and Safety entered, showing only Safety Briefing."><figcaption><p>Combining the room filter with the subject search leaves one matching booking.</p></figcaption></figure>

## Before you start

* Complete [Build a Resource Timeline from Salesforce Records](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/calendar/build-a-resource-timeline.md). Use the same query, test day and three Salesforce Events.
* Confirm the user testing the page can read the `Location` and `Subject` fields on Event.

## Steps

{% stepper %}
{% step %}

### Choose which booking fields users can use

Select the Calendar in Component Builder. In **Properties**, open **Data Mappings**. Add Event `Location` to **Filters** and select only Event `Subject` in **Search Fields**.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FFH4giNWiyl0fHIrRC4ku%2Fcalendar-filter-and-search-bookings-fields.png?alt=media" alt="Calendar field selections for the location filter and subject search." width="640"><figcaption><p>Location is available as a filter, and the search is limited to the subject.</p></figcaption></figure>
{% endstep %}

{% step %}

### Make the controls visible

In **Filter**, set **Type** to **Panel**. In **Search**, turn on **Show Search** and set **Placeholder** to `Search booking subjects`. Leave search in the toolbar so it is visible with the filter panel open.
{% endstep %}

{% step %}

### Save and test

Save the component and open the test page on the sample booking day. Compare the results with the Salesforce Event subjects and locations.

1. Open the filters panel. In the location filter, use **Equals** and select `Cedar Room`. The matching bookings are Safety Briefing and Equipment Setup.
2. Search for `Safety` with the location filter active. Only Safety Briefing should match.
3. Clear the search. Equipment Setup should return. Clear the room filter to see all three bookings again.
4. With the room filter cleared, search for `Maple Room`. There should be no matching bookings because this search checks the subject. Clear the search when you finish.
   {% endstep %}
   {% endstepper %}

## Troubleshooting

<details>

<summary>The panel opens without the location filter</summary>

Check **Data Mappings > Filters** for `Location`. **Filter > Type** controls where filters appear. The field selection controls which record filters are available.

</details>

<details>

<summary>Search returns fewer bookings than expected</summary>

Clear the location filter and check the selected date. This configuration searches Event `Subject` within the records available for the current view and query.

</details>

## Related tutorials

* [Build a Resource Timeline from Salesforce Records](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/calendar/build-a-resource-timeline.md) to map Event records to account rows.
* [Show Booking Details on Hover](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/calendar/show-booking-details-on-hover.md) to confirm the room from a booking's popover.
* [Calendar reference](https://docs.avonnicomponents.com/dynamic-components/components/calendar.md) for filter operators and other layouts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/dynamic-components/tutorials/components/calendar/filter-and-search-bookings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
