Skip to content

Using the VQL Editor

Vault Toolbox includes a VQL Editor for running read-only Vault queries directly within Visual Studio Code. The VQL Editor features syntax highlighting, a Query Builder, saved queries, query history, query formatting, and CSV export.

This guide outlines how to write and run queries in the editor and build queries visually with the Query Builder. Learn more about sending VQL queries.

To run a query:

  1. Select the Vault Toolbox icon in the lefthand panel.
  2. Select the VQL Editor () tab.
  3. Type a VQL statement in the editor, or select a query from the saved-queries or history dropdown. For example, SELECT id FROM documents.
  4. Optional: Click () Format Query to reformat the query for readability.
  5. Click Run VQL, or press Cmd+Enter (macOS) or Ctrl+Enter (Windows/Linux).
    Vault Toolbox Visual Studio Code Extension VQL Editor ResultsVault Toolbox Visual Studio Code Extension VQL Editor Results

Results display in a table below the editor. Use ‹ Prev and Next › to page through results. A range label shows how many of the total rows are currently displayed. Click JSON next to Table to view the raw response instead of a grid.

Click next to the VQL Editor title to open the editor in a full editor tab within Visual Studio Code instead of the sidebar panel. The query, results, and view mode stay in sync between the sidebar and the full editor tab.

Click () Save Query to save the current query under a name. Open the Saved dropdown to load or delete a saved query, or filter the list by name. Open the History dropdown to re-load one of your recent queries, or clear your history.

Click () Download CSV in the editor header to export all pages of the query results to a CSV file. If the results exceed 10,000, Vault Toolbox prompts you with a warning dialog prior to downloading.

The Query Builder helps you construct a VQL statement without writing it by hand. Pick a query target, choose which fields to select, add filter conditions, and optionally set a page size, then insert the result into the editor.

To build a query visually:

  1. From the VQL Editor, expand the Query Builder and select a query Target. For example, Product.
  2. Select Fields. Picking a field on the object itself adds it directly. Picking a field through a relationship adds either a dotted relationship.field expression or an inbound subquery, depending on the relationship direction.
  3. Optional: Click + Add filter to add a WHERE clause. Select a Field, an operator valid for that field's type (=, !=, <, >, <=, >=, CONTAINS, LIKE), and a Value. Use the match mode to combine multiple filter rows with AND or OR.
  4. Optional: Enter a Page Size. Leave blank to use the default page size.
  5. Click Build Query in Editor.
    Vault Toolbox Visual Studio Code Extension VQL Editor Query BuilderVault Toolbox Visual Studio Code Extension VQL Editor Query Builder

The generated query does not run automatically. Review and edit it in the editor, then click Run VQL to send it.