Client API
Variables

Variables Method

What is the Variables Method?

The Variables Method allows you to personalize survey text based on dynamic variables. For example, you can directly pass a user's name to address them in your welcome text.

E.g. "Hey Michael, what do you think about our new feature?"

How to use the Variables Method

In your survey text, you can use the following syntax to pass variables:

{{ variable_name | "default value" }}

For example, if you want to address the user by their name, you can type the following in your survey text:

Hey {{ name | "there" }}, what do you think about our new feature?

Then, you can pass the variables you want dynamically using the Variables Method like this:

<script>
  window.lb("variable", {
    name: "Michael Scott",
    age: 40,
  });
</script>