**Source URL:** https://general.veevavault.dev/vault-toolbox/browser-extension/guides/vql-editor.md

# Using the VQL Editor

Vault Toolbox includes a VQL Editor that allows you to send Vault Query Language (VQL) queries to access, retrieve, and interact with Vault data. The VQL Editor includes a [Query Builder](#query-builder) interface to assist with building VQL queries. See the [VQL Overview](/vql/overview) to learn more.

This guide explains how to use the VQL Editor to build, run, and save VQL queries, as well as download their results.

<ThemeImage srcLight="/images/toolbox/browser-extension/vql-editor_light.png" srcDark="/images/toolbox/browser-extension/vql-editor_dark.png" alt="Build and execute queries with the VQL editor"></ThemeImage>

## Querying Vault {#querying-vault}

To send a VQL query, you can enter the query directly in VQL Editor or build one using the [Query Builder](#query-builder). Click **Run VQL** to send the query.

### Viewing & Downloading Query Results {#viewing--downloading-query-results}

Query results appear in the bottom half of the editor. You can select **Table** or **JSON** below the query results panel to change the format of the results. Click **Download CSV** to download query results in CSV format.

The VQL Editor retrieves results using the default `PAGESIZE`. You can reduce this by setting the `PAGESIZE` in your query. Click **Next Page** and **Previous Page** at the bottom of the editor to navigate through results. Learn more about `PAGESIZE` in the [VQL documentation](/vql/clauses/pagesize).

### Saving Queries {#saving-queries}

The VQL Editor allows you to save up to 20 queries. This is helpful for preserving long or complicated queries for future use.

To save the query currently in the editor:

<Steps>
1. Click **Save Query** (<Icon name="ph:floppy-disk"></Icon>).

2. In the dialog, provide a name for the query and select it from the dropdown. Provide the name of an existing query to overwrite it.

3. Optional: To make the query load automatically when you open the VQL Editor, select the **Default?** checkbox. Doing so unsets any previously set default query.

4. Click **Save** (<Icon name="ph:floppy-disk"></Icon>).

</Steps>
Click the <Icon name="ph:dots-three"></Icon> icon to view a dropdown menu listing your saved queries. To insert a saved query, select its name in the list. To delete a saved query, click **Delete Saved Query** (<Icon name="ph:trash"></Icon>) and select a query. In the dialog, click the **Delete** to confirm or the **Cancel** to return to the editor.

## Using the Query Builder {#query-builder}

The Query Builder in the right panel of the VQL Editor allows you to select values from dropdowns to build a query. This is especially helpful if you don't know the API names of the objects, fields, relationships, or picklist values you want to query. Toggle the <Icon name="ph:tree-structure"></Icon> icon to hide or show the Query Builder.

To build a query with the Query Builder:

<Steps>
1. Select the **Category** of the query target.

2. Select a query **Target**. This value will be added to the query's `FROM` clause.

3. Select one or more **Fields**. These values will be added to the query's `SELECT` clause.

4. Optional: Click **+ Add Filter** to set values for the query's `WHERE` clause.

5. Optional: To add additional filters, click **+ Add Filter** again. Select an operator, either **AND** or **OR**. To remove a filter, click the red minus (**-**) icon.

6. Click **Build Query in Editor**. Your query will appear in the editor panel.

7. Click **Run VQL** to run the query.

</Steps>

## Viewing Query History {#viewing-query-history}

The VQL Editor is capable of storing your query history. To see queries you’ve previously run in all environments, click **Query History** (<Icon name="ph:clock-counter-clockwise"></Icon>) in the right sidebar.

You can click the <Icon name="ph:caret-right"></Icon> icon next to a query to expand its details, including the *Time* it was executed, *Target*, *Results*, *Response Time*, *Response Size*, *Query String*, and *Execution ID*.

Click **Rebuild** (<Icon name="ph:arrow-counter-clockwise"></Icon>) to copy a query into the editor panel to run again.



---

**Previous:** [Using the Component Editor](/vault-toolbox/browser-extension/guides/component-editor)  
**Next:** [Utilizing Data Tools](/vault-toolbox/browser-extension/guides/data-tools)