> 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/data-table/set-up-search.md).

# Set Up Search

Add a search box to a Data Table so users find a record by typing part of its name, including in fields the table does not show.

A sales rep opens a table of 200 open deals and needs the one for Northwind Traders. Scrolling is slow and sorting does not help. A search box above the table lets the rep type "Northwind" and see only the matching rows.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FXW0HJTecjLHfWuDqRLlj%2Fdata-table-tutorial-set-up-search-result.png?alt=media" alt="Open deals table with a full-width search box containing Northwind, showing 3 items found: Northwind - Platform renewal, Northwind - Integration services and Northwind - Field service add-on, all on the account Northwind Traders"><figcaption><p>Typing Northwind keeps only the deals whose name or account matches.</p></figcaption></figure>

## Before you start

* A [Data Table](https://docs.avonnicomponents.com/dynamic-components/components/data-table.md) with its columns mapped. This tutorial uses a table on Opportunity with a [Query](https://docs.avonnicomponents.com/dynamic-components/component-builder/data-sources/query.md) data source and the Opportunity Name, Account Name, Stage and Amount columns.
* Searching fields that are not displayed (step 3) needs a Query data source.

## Steps

{% stepper %}
{% step %}

### Make a column searchable

The search box appears only once at least one displayed column is searchable.

1. Select the Data Table on the canvas.
2. In the Properties panel, open the **Data Mappings** section and click the Opportunity Name column. The **Columns** list names each column by its field, here `Name`.
3. Turn on **Searchable**.
4. Repeat for the Account Name column.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fw8MTaM3wBv7ASuvhGbfL%2Fdata-table-tutorial-set-up-search-column-searchable.png?alt=media" alt="Column settings of the Opportunity Name column with the Searchable toggle turned on" width="320"><figcaption><p>Searchable turned on for the Opportunity Name column.</p></figcaption></figure>

To make every column searchable at once, turn on **All Columns Searchable** in the advanced options of the **Content** section instead.
{% endstep %}

{% step %}

### Shape the search box

Open the **Search** section of the Properties panel.

* **Placeholder**: the hint shown in the empty box, for example `Search deals or accounts`. The default is `Search`.
* **Position**: **Left** (default), **Right**, **Center**, **Fill** (the box takes the full width of the header), or **Panel** (the box moves to a side panel, see step 5).
  {% endstep %}

{% step %}

### Search fields the table does not show (optional)

Reps sometimes remember where a deal came from rather than its name. You can search on Lead Source without adding a column for it.

1. In the **Data Mappings** section, open **Search Fields**.
2. Select `Lead Source`.

The search now covers the searchable columns plus every field listed here. A field in **Search Fields** does not make the search box appear by itself: keep at least one displayed column searchable.
{% endstep %}

{% step %}

### Open the table already searched (optional)

In the **Search** section, set **Default Search Value**. The table loads with that term in the box, then filters to the matching rows a moment later. Users can clear it or type something else.

Example: a "Renewals" page that opens on the term `Renewal`.
{% endstep %}

{% step %}

### Put the search in a side panel (optional)

1. Set **Position** to **Panel** in the **Search** section.
2. Open the **Side panel** section and choose its **Position** (**Left** or **Right**).
3. Turn on **Closed by Default** if the panel should start collapsed. Users open it with the toggle button in the header, unless you turn on **Hide Toggle Button**.

If you also follow [Add User Filters](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/add-user-filters.md) and set the filter **Type** to **Panel**, search and filters share the same side panel.
{% endstep %}

{% step %}

### Save and test

Save the component and open the page where it is placed. Type `Northwind` in the search box: only the deals whose name or account contains "Northwind" remain. Clear the box and every row comes back.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

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

* No displayed column is searchable. Open a column in **Data Mappings** and turn on **Searchable**. Fields listed only in **Search Fields** and Hidden columns do not count.
* The Searchable toggle is missing on a column: its type does not support search. The toggle is not offered on types such as Avatar, Percent, Text Area or Time.

</details>

<details>

<summary>A column is searchable but typing a value from it finds nothing</summary>

* Long Text Area and Rich Text Area fields cannot be searched with a Query or Variable data source, because Salesforce does not allow filtering on them. Searchable has no effect on these columns.
* On a Lookup column, the search matches the related record's name (the account name, for example), not its Id.

</details>

<details>

<summary>The side panel does not appear</summary>

When the Data Table is narrow, a search set to **Panel** is shown in the header instead, and filters set to **Panel** are shown in a popover. Give the component more width on the page to get the side panel.

</details>

## Related tutorials

* [Add User Filters](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/add-user-filters.md): let users narrow the table by picking values, alongside the free-text search.
* [Enable Data Export](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/data-table/enable-data-export.md): export the rows a user has just found.
* [Data Table](https://docs.avonnicomponents.com/dynamic-components/components/data-table.md): the reference for every Data Mappings and Search property.


---

# 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/data-table/set-up-search.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.
