> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightdash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Remember filters in a data app

> Make a data app reopen with each viewer's own filters, tab, and sort order, on any device

[Experimental](https://docs.lightdash.com/support/feature-badges.md#experimental)

## What you'll build

An app that opens the way each viewer left it, with their filters, active tab, and sort order restored on any device, plus a **Reset** button that brings back the defaults.

![A data apps timeline with the 12 months timeframe and Week granularity selected, a reset button next to the filters, and a chart of app views and apps created](https://mintcdn.com/lightdash/tjaqEXBi-FOtt6H4/images/data-apps/remember-filters-in-an-app/saved-filters-hero.png?fit=max\&auto=format\&n=tjaqEXBi-FOtt6H4\&q=85\&s=759a5e485852c4962a61d5f6150e144e)

## Before you start

* **Data apps** on your Lightdash instance. See [Data apps](https://docs.lightdash.com/data-apps).
* **Saved app state** turned on for your organization. See [Saved app state](https://docs.lightdash.com/data-apps/saved-app-state.md).
* **A data app with filters or other controls** that you can edit. To start from scratch, create an app with the **Dashboard** template and attach an existing dashboard as context. See [Creating a new app](https://docs.lightdash.com/data-apps#creating-a-new-app).

## Copy the prompt

Open your app, copy this prompt, and send it as your next prompt to the app agent.

Prompt
Copy this prompt to your clipboard

<pre>
  Remember each viewer's own choices in this app:

  * Save my filter selections, the active tab, and the sort order, so the app opens the way I left it, on any device.
  * Keep these choices private to each viewer.
  * Add a Reset button next to the filters that restores the defaults.
  * Show a small "not saved" hint when saving isn't available.
</pre>

Paste into the prompt box of your app, then send it.

The agent builds a new version of the app that saves these choices in [user storage](https://docs.lightdash.com/data-apps/saved-app-state.md#user-storage). Choices save as you make them, so there's no save button.

## Try it

**1. Change the view**

Pick filter values that differ from the defaults, switch to another tab, and change a sort order.

**2. Watch a save**

Open **View network** in the preview header and select the **Requests** tab. With the panel open, change a filter again. A row with an **app state** badge appears for each call: a `set-user` row for your change, with the value size and duration. A save that fails shows an error code instead of **ok**. See [Network inspector](https://docs.lightdash.com/data-apps#network-inspector).

**3. Reopen the app from the app list**

Close the app, then open it again from its space or from **Settings** → **My apps**. Don't use a copied link or your browser history: the page address carries [view state](https://docs.lightdash.com/data-apps#sharing-a-link-to-the-current-view), which can restore your selections even if saving failed. The app opens with the filters, tab, and sort order you left it with. Open it the same way on another device while signed in as you, and you get the same view.

**4. Check that it's private**

A personal app is only visible to you, so first [move it into a space](https://docs.lightdash.com/data-apps#sharing-an-app) your teammate can access. Ask them to open the app from that space, not from a link to your current view. They see the defaults, or the choices they saved themselves, never yours.

Your saved choices stay private, but selections in a link you share travel with the link. When someone opens a link with view state, those values take priority over their own saved choices.

**5. Reset**

Click **Reset**. The defaults return, and the app saves them as your new choices. Close the app and reopen it from the app list to confirm it opens with the defaults.

## Make it yours

Send any of these as a follow-up prompt.

Put the view in the page link, so a colleague who opens your link sees the same view:

```text theme={null}
Also put the selected period and region in the page link, so anyone who opens my link sees the same view.
```

Add comments the whole team can see, saved in [shared storage](https://docs.lightdash.com/data-apps/saved-app-state.md#shared-storage). For a full walkthrough, see [Add shared team comments](https://docs.lightdash.com/data-apps/add-shared-comments-to-an-app.md).

```text theme={null}
Let the team leave comments on each region, visible to everyone who opens the app. Show who last changed the comments and when, and add a Refresh button to the comments panel.
```

Save AI commentary once per selection and share it with every viewer. This needs [AI analysis](https://docs.lightdash.com/data-apps/ai-analysis.md) turned on.

> [!WARNING]
>
> Unlike your saved filters, shared commentary is content every viewer of the app can read, including viewers with different data permissions. A viewer may read commentary generated from data they couldn't query themselves. See [For app code](https://docs.lightdash.com/data-apps/ai-analysis.md#for-app-code) before you use it with row-level access.

```text theme={null}
Add AI commentary under the main chart that is saved and shared between viewers, and let anyone edit the text.
```

## How it works

* [Saved app state](https://docs.lightdash.com/data-apps/saved-app-state.md) explains user and shared storage, what embedded viewers can do, and the storage limits.
* [See what an app has saved](https://docs.lightdash.com/data-apps/saved-app-state.md#see-what-an-app-has-saved) covers the **App state** panel, where people who can manage the app review shared keys and their history.
* [Network inspector](https://docs.lightdash.com/data-apps#network-inspector) explains the **Requests** tab and its app state rows.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.