
## Make a query interactive

URL: https://docs.atlan.com/product/capabilities/insights/how-tos/make-a-query-interactive

> Make queries interactive by defining custom variables that others can modify. Share queries with controlled modifications where only variable values can change, not the underlying query logic.

Make queries interactive by defining custom variables that other users can modify while protecting your underlying query logic. When you share a query as interactive, others can only change the values you've designated as interactive—not the query itself—allowing them to customize results for their needs.

:::warning Who can do this?
 The owner of the query, or anyone with edit access to the query can make it interactive. Once interactive, anyone with read-only access to the query can also edit _only_ the interactive part.

:::

## SQL queries

To make a SQL query interactive:

1. From the left sidebar, click on **all assets** and then click on Data Exploration to open Data Exploration.
 * If you are using the **Old UI (Classic)**, from the left menu of any screen, click **Data Exploration**.

2. Open the query in Data Exploration.
3. Highlight the value you want to be interactive.
4. On the bar separating the query from the results, click the curly braces icon and then click the **Add variable** button.
5. Click the settings icon to the right of the _Enter a string_ text box to define the custom variable:
 1. For _Name_, enter a meaningful name for the custom variable.
 2. For _Type_, change the data type of the custom variable, if necessary.
 3. For _Default value_, enter the value to use for the custom variable if other users do not change it.
6. At the bottom of the _Edit_ dialog for the custom variable, click **Save**.
7. In the upper right of the query editor, click **Run** to confirm the query still operates as expected.

That's it, your query is now interactive! 🎉

:::info **Did you know?** 
 You can select from a wide range of data types for your custom variables - string, number, date, date and timestamp ranges, and multi-value options.

:::

## VQB queries

To make a Visual Query Builder (VQB) query interactive:

1. From the left sidebar, click on **all assets** and then click on Data Exploration to open Data Exploration.
 * If you are using the **Old UI (Classic)**, from the left menu of any screen, click **Data Exploration**.

2. Open the query in Data Exploration.
3. Find the value you want to be interactive.
4. In the right of the box for that value, click the lightning bolt icon.
5. In the upper right of the query editor, click **Run** to confirm the query still operates as expected.

That's it, your query is now interactive! 🎉

---
