Bring back preview button on queries

I'm no longer seeing the preview button for queries in my Retool instance - this is quite breaking for developing as it requires us to save our queries if we want to test them. Any chance we can roll this change back?

1 Like

Second this!

Just tagging this related thread for visibility Enable again the (Preview) button in queries in Multi-page apps - #5 by Darren

Thanks for spreading the word, @MiguelOrtiz! Let me know if you have any questions, all. :+1:

is there plans to bring this back @darren?

Yes! Our Product team is keeping an eye on these topics to help inform next steps.

Hey all - I'm jumping in here real quickly to highlight the fact that we restored one piece of Preview functionality by allowing users to optionally visualize query output as JSON.

Keep an eye out for future updates as we continue to work on this. :+1:

1 Like

Hey folks —

I’m on the Product Design team at Retool, and as Darren mentioned, we’re thinking about how best to fold Preview functionality back in!

One thing we want to communicate with this design is that there are two ways you can execute a query from the Query Editor:

  • Run executes the query against your resource, and propagates the resulting data into your app: components will update, other queries that depend on its value will run, et cetera.
  • Preview (which we want to rename to Test) executes the query against your resource, but only displays the output in the lower pane of the Query Editor.

We originally removed Preview because we were concerned it sounded too ephemeral: some queries can have lasting effects (writes, deletes, et cetera), and we were concerned the word Preview didn’t capture that. We are planning to reintroduce this button under the name Test. It’s a subtle change, but we think that captures the behavior better. (We considered other names, such as Run in Query Console, but — while more accurate — those felt too wordy.)

While we were considering this change, we also noticed some additional confusion: unsaved queries set to run automatically had a button called “Save & Run,” whereas manual queries had a button just called “Save.” (Once saved, both buttons would turn into “Run.”)

Automatic queries are best used for lightweight, standalone queries: they may be read-only, and may not depend on any other information or interactions from your app. Executing them via either “Test” or “Run” should be straightforward:

Manual queries, on the other hand, are trickier: they may delete data, read from extremely large datasets, or depend on variables that may not be fully initialized in the IDE.

Running or Testing these queries may be destructive, or may simply not work if the query depends on additional state. And even if they do work, Running a manual query from the Query Editor, rather than via whatever interaction triggers it in your app, may put your app into a state in the IDE it can’t possibly be in in production.

Therefore we propose a slightly different layout for manual queries: Save is the most prominent action, Test remains available, but Run (here called “Run in App”) is much less prominent.

We know there are lots of different workflows and ways to use queries — we appreciate any thoughts you have about whether these changes will make your experience better!

— Andrew Watterson
Product Design, Retool

2 Likes