> 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/flow/tutorials/components/timeline/search-and-filter-a-timeline.md).

# Search and filter a timeline

Add a search bar and Status and Priority filters to a Timeline, so users find one activity among dozens, and set what an empty search shows.

Two months of calls, emails and follow-ups on Harbor Point Logistics make a long Timeline. Before a renewal call, the account manager wants every high priority task that is still open, or the one call where the customer mentioned "dock". A search bar and two filters on the **Avonni Timeline** answer both without scrolling.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FEoVb0uMTS1Si4BefMdmE%2Ftimeline-search-and-filter-a-timeline-result.png?alt=media" alt="Avonni Timeline with a search bar and a filter button, narrowed to two open high priority tasks" width="460"><figcaption><p>The Status and Priority filters narrow the Timeline to two tasks.</p></figcaption></figure>

## Before you start

* A Timeline that already shows the account's Tasks with a **Query** data source: [Show a record history with a query](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/show-a-record-history-with-a-query.md) sets one up. With a **Variable** data source ([Display Tasks](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/display-tasks.md)), filters work the same way, but the search ignores **Search Fields**: it matches the item's own text, such as its title.
* Search fields and filters are picked from the object's fields, so a **Manual** data source has neither.

## Steps

{% stepper %}
{% step %}

### Turn on the search bar

1. Select the Timeline on its screen and click **Open Component Builder**.
2. In the **Properties** tab, open the **Search** section and turn on **Show Search**.
3. Set **Placeholder** to `Search activities` and **Position** to **Fill**.
   {% endstep %}

{% step %}

### Choose the fields the search looks in

1. Open **Data Mappings**. Under **Search Fields**, add `Subject` and `Type`.
2. Leave it empty if the Title and Description are enough: the search then uses the fields behind the **Title** and **Description** mappings.

Long text fields such as **Comments** (`Description`) cannot be searched in a Query, because Salesforce does not allow filtering on them. Picked in **Search Fields**, they are ignored.
{% endstep %}

{% step %}

### Add Status and Priority filters

1. Still in **Data Mappings**, under **Filters**, add `Status` and `Priority`.
2. In the **Properties** tab, open the **Filter** section and turn on **Display As Popover** to show the filter menu as a popover.
3. Optional: turn on **Use Cascading Filter Values**. Picking `High` in **Priority** then limits the **Status** options to the statuses that high priority tasks actually have.
   {% endstep %}

{% step %}

### Decide what an empty result shows

When a search matches nothing, the Timeline shows an illustration with the message `No results for "<search term>"`. With a **Query** data source, it also shows when the account has no tasks at all.

1. In the **Properties** tab, open the **No Results Message** section.
2. To replace the text, fill **No Results Message**, for example `No activity matches this search.` Your text replaces the default one, search term included.
3. To show text only, turn on **Hide No Results Image**. To show nothing at all, turn on both **Hide No Results Image** and **Hide No Results Message**.

{% hint style="info" %}
End users sometimes read the default illustration as a broken component. If your Timeline often comes back empty, a short message of your own avoids the question.
{% endhint %}
{% endstep %}

{% step %}

### Save and test

Click **Done**, save and activate the flow, and open it on Harbor Point Logistics.

* Type `dock` in the search bar: only the activities whose subject or type contains "dock" stay.
* Open the filters, pick `High` in **Priority** and `Not Started` in **Status**: the list narrows to open high priority tasks.
* Search for `zzz`: the Timeline shows your **No Results Message** instead of the items.
  {% endstep %}
  {% endstepper %}

## Troubleshooting

<details>

<summary>The search bar does not appear</summary>

**Show Search** is off. **Search Fields** alone does not add the bar: it only tells an existing bar where to look.

</details>

<details>

<summary>The Filters and Search Fields settings are missing</summary>

The Timeline uses a **Manual** data source. Switch to **Variable** or **Query**.

</details>

<details>

<summary>A word in the task comments is never found</summary>

**Comments** (`Description`) is a long text field and cannot be searched in a Query. Search on **Subject** or another short field.

</details>

<details>

<summary>Users report a broken image in the Timeline</summary>

It is the empty state: the search or the query returned nothing. Set a **No Results Message**, or hide the image, as in the empty result step.

</details>

## Related tutorials

* [Show a record history with a query](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/show-a-record-history-with-a-query.md): the Query data source that feeds this Timeline.
* [Act on a timeline item](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/act-on-a-timeline-item.md): once the task is found, open it in a panel or delete it.
* [Group a timeline by month](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/group-a-timeline-by-month.md): another way to make a long Timeline readable.


---

# 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/flow/tutorials/components/timeline/search-and-filter-a-timeline.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.
