Button Click Variables

  • Updated

To make gathering data from end-users as convenient as possible, Zingtree lets you assign text or numeric values to variables when buttons are clicked from any node. These are known as Button Click Variables. Here's how it works:

  1. Edit the node where you want to set up a button click variable.
  2. Check Assign Button Click Variable.
  3. Enter the variable name.
  4. In the right column, enter the values to assign the variable for each button option.

Here's an example:


In the above configuration, the variable time_of_day will be set to "morning" if the first button is clicked, "afternoon" if the second button is clicked, and "night" if the last button is clicked.

Using Multiple Button Click Variables

You can have more than one variable set as a button click variable. Here's how:

  • For the variable name, enter multiple variables separated by a |.
  • For the values, separate them with | as well.
  • Note In cases where you may have multiple variables to set on button click but not all of the values have multiples, the single value will be applied to all of the variables.


Bonus: Variables-in-Variables

Button click variables can contain other variables. For the above example, the score/value could contain this:

morning at #time#

And the value of time would be inserted into the variable.


Was this article helpful?

1 out of 2 found this helpful

Have more questions? Submit a request

Didn't find what you need?

Our friendly customer support team is here to help

Submit a Ticket

Looking for help or advice?

Reach out to our knowledgeable community of users.

Zingtree Community