Skip to main content

How do you run a query from user input?

Comments

5 comments

  • Permanently deleted user

    Hi Ethan,

     

    Your where clause has to mix both plain text (strings) and the output value from the textbox. Anything in double quotes is interpreted as a text string, and not as a reference to an activity output.

    There's a couple options for formatting:

    • ="propertyid='" + $form1.state.textBox1.value + "'"
    • =`propertyid='${$form1.state.textBox1.value}'"`

     

    The first one uses concatenation, the second uses template literals, where anything inside a ${} token is interpreted as an expression instead of a string.

    0
  • Ethan Granger

    Thanks. All the examples had the template literal style and it threw me off. Makes sense now.

    0
  • Ethan Granger

    I'm finding the literal style is very inconsistent. Sometimes it works and sometimes it doesn't. I had it in two queries in a single workflow and when I ran it, it worked on one and not on the other.

    0
  • Permanently deleted user

    Hi Ethan,

     

    If you'd like to share a copy of your workflow here, I could take a look and see if I can find anything wrong with the second query or its template literal expression. You can export a copy of a workflow from File > Export in the designer, and attach it to a community post using the paperclip icon below the reply box.

    0

Please sign in to leave a comment.