Hi I am new to building apps with Retool, though I've used App Designer (formerly GUIDE) from MATLab.
I want to build a very simple functionality for my team. Use a text box to write a value, pass that value to the SQL call to a table. The reason they can't just directly filter the table is because the value they input into the textbox is encoded in the actual database, and so the SQL call has the plain text value wrapped in the encoding function.
It seems like you have to write a static query and link it to the table. Is there anyway to make it dependent on a value?
Thanks for any pointers or guidance.
Hi!
Just a few ideas: do you submit the text field? If not, you need a bit of javascript to monitor a change in the text field that triggers your encoding function and that triggers the SQL call.
Does that help in any way? You make the queries (text change, encoding function, SQL call) follow each other up, using 'success actions'.
Maybe others can chime in with better proposals. Feel free to provide some feedback to this so we can help you better.
I have a button that I want to have it look at the textboxes (use their handle.value) to create the query, but then have the table choose that updated query. If this all needs to be done in JS, I can certainly look into that. Thanks for the suggestion!
More on this. I have two textinput boxes, and I have a text display.
I was able to include {{ textInput1.value}}{{ textInput2.value }} into the text display, so that now when I change the values in the text boxes, the displayed text changes.
I essentially want this to happen inside the query! Will continue looking but so far this is my progress
Figured it out! My issue was that I was trying to use WHERE value ={{ textInput1.value}}{{ textInput2.value }}, when I needed to use WHERE value = CONCAT({{ textInput1.value}} , {{ textInput2.value }})! Now the query is generalized to the input fields!
2 Likes