Hoppa till huvudinnehållet

How to make dynamic text. For example: User types his name and a alert appears saying "Hello (your name)"

Kommentarer

2 kommentarer

  • Officiell kommentar
    Ryan Cooney

    JavaScript Template Literals to the rescue. They use the backtick character ` and allow you to easily insert variable values into a string/text.

    For example:

    • =`Hello ${$form.state.textBox.value}`
    • =`State = '${$form.state.textBox.value}'`

    One caution on that second example that is assembling a where clause. If the textbox value contains any single quotes it'll break your where clause. Your workflow can deal with this though. There is a "Text Replace" activity that can escape them. Or if your values come from something like a drop down list you don't have to worry about it.

  • Gustavo

    Hey Ryan, thank s a lot for your quick answer, that's exactly what I was looking for! I knew the solution would be something simple like that.

    1

Du måste logga in om du vill lämna en kommentar.