> For the complete documentation index, see [llms.txt](https://docs.rowsncolumns.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rowsncolumns.app/configuration/features/basic-filter-or-excel-autofilter.md).

# Basic filter or Excel AutoFilter

To create a filter from your data,

1. Select a selection or focus on a cell which has some data around it
2. Press `Ctrl/Cmd + Shift + F`
3. Or Right click on the cell and select `Create a filter`

This will convert a selection to a filter

<figure><img src="/files/Nl5j8Yu4SOBPQIdKnSFU" alt=""><figcaption><p>Auto filter</p></figcaption></figure>

Wiring up autofilter using `useSpreadsheetState`

{% code overflow="wrap" %}

```tsx
import {
  SpreadsheetProvider,
  CanvasGrid,
  Sheet
} from "@rowsncolumns/spreadsheet";
import { useState } from "react";
import { useSpreadsheetState } from "@rowsncolumns/spreadsheet-state";

const MySpreadsheet = () => {
  const [ sheets, onChangeSheets ] = useState<Sheet[]>([])
  const { basicFilter, onCreateBasicFilter } = useSpreadsheetState({
    sheets,
  });
  return (
    <CanvasGrid
      basicFilter={basicFilter}
      onCreateBasicFilter={onCreateBasicFilter}
    />
  );
};

const App = () => (
  <SpreadsheetProvider>
    <MySpreadsheet />
  </SpreadsheetProvider>
);
```

{% endcode %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rowsncolumns.app/configuration/features/basic-filter-or-excel-autofilter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
