Skip to main content

Make a query interactive

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.

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. Open the query in Insights.
  2. Highlight the value you want to be interactive.
  3. On the bar separating the query from the results, click the curly braces icon and then click the Add variable button.
  4. 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.
  5. At the bottom of the Edit dialog for the custom variable, click Save.
  6. 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! 🎉

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. Open the query in Insights.
  2. Find the value you want to be interactive.
  3. In the right of the box for that value, click the lightning bolt icon.
  4. 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! 🎉