Clear the query builder programmatically?

When I select an event handler on eg. a button, to control the query builder there is no available methods for the query builder. How do i clear the input on the query builder from another component or after a successful query?

Hello! Thanks for writing in. :grinning_face_with_smiling_eyes:

So, the query builder is a largely unsupported component. As in, the built-in methods that you see in other components aren't available. Thankfully, we do have a workaround!

  1. Use Retool's temporary state (docs here) to create a new temporary state. You can set it to have a default value.
  2. Set your target component's value to be that state (referenced in double curlies)
  3. Write a JS query or use the event handler you mentioned to update state — state1.setValue(new_value_here)
  4. Run this JS query/event handler to update the state, and therefore, update your target component!

Please, let me know if you have any questions!