Query Builder Presets

Hey Retool Community,

We're using Retool as an internal tool, and one of the functionalities we have is using the Query Builder in order to create a custom search for specific entities.
At the moment, each user can just use the Query Builder to construct their own "WHERE" clause.
Ideally, we would like to have buttons that save / load / deploy specific presets. For example, if we know that many of our searches have "Salesforce Status = ACTIVE AND Company Name = XYZ", we would like to have a button that will automatically inject these parameters / settings into the Query Builder object.

So one option we would like to think about is just pre-defining these presets and deploying them using buttons. The other option would be to actually create your own presets as a user - just saving them to the system or loading them from the system.

Is that something we can achieve?

Thanks alot!

Still wondering - I tried to look further into this but couldn't find any way to manipulate the Query Builder's value using JS.

Is this unachievable?

Hi @Shai-D, welcome to the community.

I'm not sure I understand completely but here's something.

Try to set queryBuilder1.value to a temporary state variable. Then you could use an event handler to set the temp state to your "template" variable which could be stored in another temp var, app js, global js, etc... I wouldn't say that I have tested this completely but here is what I came up with.


Hey Matt,
Thanks! I didn't think of that :sweat_smile:
I believe it should provide me with the solution I need.

Again, thanks!