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

# Saved views

> Keep a SQL or PromQL query under a name, open it again with its time window, pin the ones a team uses most, and build reports on them.

A saved view is a named SQL or PromQL query that the workspace shares. Open it again in one click
instead of rewriting the query, use it as the content of a [report](https://docs.molesignal.com/en-US/reports.md), and find it with
the command palette. Open **Saved views** with **Go to Saved views** in the
[command palette](https://docs.molesignal.com/en-US/console.md#search-with-the-command-palette).

## The list

The head counts the saved views and the pinned ones. Each view shows its **Language**, its **Stream**,
its **Tags**, its default **Window**, and when it changed. A pin marks the pinned views.

| Action | Effect |
| - | - |
| **Open** | Opens the query in its explorer over the window of the view, ending now. |
| **Pin** / **Unpin** | Marks the view as one the team uses most. |
| **Edit** | Changes the view. |
| **Delete** | Deletes the view. It cannot be undone. |

**Open** runs a SQL view on [Logs](https://docs.molesignal.com/en-US/logs), in SQL mode on the stream of the view, and a PromQL view
on [Metrics](https://docs.molesignal.com/en-US/metrics.md).

## Create a saved view

Select **New saved view**:

| Field | Rule |
| - | - |
| **Name** | The name shown in the list and the command palette. |
| **Language** | **SQL** or **PromQL**. |
| **Default window** | The time window that **Open** uses: 15 minutes, 1, 6, or 24 hours, or 7 days. |
| **Statement** | The query. |
| **Stream (optional)** | The stream a SQL view runs on. It also narrows the files read. |
| **Tags** | Comma-separated tags, to find the view later. |
| **Pin to top** | Pins the view. |

Select **Create**. Write a query that still makes sense for another time window: leave the time range
to the window, and filter by stable fields such as `service.name` and `deployment.environment`.

## Use saved views elsewhere

* A [report](https://docs.molesignal.com/en-US/reports.md#saved-view) renders a saved view as a table of its results, on a schedule.
* The command palette finds saved views by name.
* The **Usage** tab of a [stream](https://docs.molesignal.com/en-US/streams.md#stream-details) lists the saved views bound to it.

## Permissions

| Permission | Allows |
| - | - |
| `saved_views.read` | List and open saved views. |
| `saved_views.create` | Create saved views. |
| `saved_views.edit` | Change and pin saved views. |
| `saved_views.delete` | Delete saved views. |

Running a view also needs `streams.query`. See the [saved view API](https://docs.molesignal.com/en-US/api/query/list-saved-views.md).


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