> For the complete documentation index, see [llms.txt](https://docs.violetlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.violetlabs.com/features/data-lab.md). Agents can also search and read this documentation through its [MCP server](https://docs.violetlabs.com/~gitbook/mcp).

# Data Lab

Query your Violet data with SQL or plain language, shape the results, chart them and pin them to a dashboard.

<mark style="color:purple;">**Data Lab**</mark> lets you query the data Violet has collected from your apps. Write SQL yourself, or ask Violet a question in plain language and let it write and run the query for you.

{% hint style="info" %}
Data Lab is in beta. It appears in the sidebar when it is available for your company.
{% endhint %}

![Data Lab with the Catalog, SQL and Ask Violet panels](https://2091741164-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvrraExym8pNEUvBDoima%2Fuploads%2F6gxlx1epaKinSgbxVq0Z%2Fdocs-sync-data-lab.png?alt=media)

## Open Data Lab

Click **Data Lab** in the sidebar. The page has three panels, which you show or hide with the **Catalog**, **SQL** and **Ask Violet** buttons:

* **Catalog** lists what you can query. Pick an item to see its columns, or insert a column name into your query.
* **SQL** is the query editor, with the run bar under it.
* **Ask Violet** is a chat where you ask questions about your data.

All three panels are open the first time you visit. Data Lab remembers which panels you leave open.

## Run a query

1. In the **SQL** panel, write a query.
2. Click **Run**, or press **⌘⏎** (Mac) or **Ctrl+Enter** (Windows and Linux).
3. The results appear in the grid below the editor.

A query is a single read-only statement. It can end with a `;` and include `--` or `/* */` comments.

Use **Limit** in the run bar to cap how many rows a query returns. The run bar also shows how long the query has been running.

## Work in tabs

Each query opens in its own tab, so you can keep several queries open at once (up to 12). Click **+** (**New query tab**) to start a new one.

The **Open** menu in the tab bar lists your saved queries and recent runs. Search it by name, description or SQL. If the query you open is already in a tab, Data Lab switches to that tab instead of opening it again.

## Save a query

1. Click **Save query** next to **Run**.
2. Give the query a name and, optionally, a description.
3. Save it.

A saved query keeps its SQL and the column settings you chose for its results. To reopen it, use the **Open** menu.

## Add parameters

Put `{{ name }}` in your SQL to turn part of a query into a parameter. Data Lab shows a field for each parameter above the results, so you or your teammates can rerun the query with different values without editing the SQL.

For each parameter you can set a **Label**, a **Type**, whether it is **Required**, and whether it accepts several values (**Allow several**, used as `IN ({{ name }})`).

## Shape the results

Open the column menu or **Column settings** to change how a column looks:

* **Display name**, **Hide column**, **Pin column**, **Align** and **Wrap long text**.
* **Format as** a number or currency, with **Decimals**, **Currency**, a **Unit suffix** and **Show negatives in red**.
* **Data bar** to draw a bar in each cell, with a **Bar color**.
* **Show values as chips**, **Text color**, and rules that color a cell (or the whole row) when its value matches.

To summarize your results, use **Group rows by this column**. Choose what group rows show (**On group rows show**), turn on **Show row counts on group rows**, and add a **Total row** with its own **Total label**.

Click **Download CSV** to download the results, or **Copy results** to paste them into a spreadsheet.

## Chart your results

Switch to the **Chart** view and pick a **Chart type** to plot the current results. Click **Download PNG** to save the chart as an image.

## Pin results to a dashboard

1. Run a query.
2. Click **Pin to dashboard**.
3. Pick the **Dashboard** and enter a **Widget title**.

The widget shows the query's results on that [dashboard](https://docs.violetlabs.com/features/dashboards.md).

## Ask Violet

In the **Ask Violet** panel, ask for rows, a roll-up or a chart in plain language. Violet writes the SQL, runs it, and the results land in the results grid, where you can shape, save or pin them like any other query. Each tab keeps its own conversations.

The model button below the chat box chooses which AI model answers. Pick a provider, if your company has connected more than one, then one of the models it lists, or **Default (recommended)**. The choice is saved with the conversation.

Company admins can turn Ask Violet off for everyone: in **Company Settings › Company Profile**, under **Preferences**, switch off **Data Lab: Ask Violet**. When it is off, the Ask Violet panel and past chats are hidden. It is on by default.

## Related pages

* [Data Models](https://docs.violetlabs.com/features/data-lab/data-models.md): the data models Data Lab reads, and how admins customize them.
* [Dashboards](https://docs.violetlabs.com/features/dashboards.md)


---

# 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.violetlabs.com/features/data-lab.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.
