Variables

Variables let you display dynamic content in your flows — product pricing, offer details, and other data that updates based on each user’s context. Use them to control element visibility and personalize screen content.

To open the variable panel, click the { } icon in the left panel. The panel has three tabs:

  • Custom: Variables you create and manage yourself.
  • Product: Built-in variables that pull localized product and offer data from the store.
  • Element: Variables bound to element states on the canvas.

Custom variables

Create a custom variable

  1. In the variable panel, click +.
  2. Enter a name for the variable.
  3. Select a type: String, Number, or Boolean.
  4. Set an initial value. This is the value the variable holds when the flow starts.
  5. Click Create variable.

Use dots in names to group related variables — for example, user.score or user.goal.

Creating a custom variable

Update a variable via an interaction

See the Actions article for more details.

You can update a variable value at runtime by adding a Set up variables action to any element.

  1. Select an element on the canvas.
  2. In the Interactions tab, click Add trigger.
  3. Select On tap and click Add action. From the Action type dropdown, select Set up variables.
  4. Click Add variable. Select the variable and set the new value.

For example, you can assign a different value to user.goal based on which quiz answer a user selects, then use that variable to navigate them to a different screen.

Updating a variable via an interaction

Product variables

Product variables pull localized data directly from the app stores. Use them in text fields to display accurate prices, titles, and offer details for each user’s locale and eligibility.

VariableDescriptionExample
<PROD_TITLE/>Localized title of the productPremium Subscription
<PROD_PRICE/>Localized price for one billing period$9.99
<PROD_PRICE_PER_DAY/>Subscription price divided by days in the billing period. Empty for non-subscriptions.$0.33
<PROD_PRICE_PER_WEEK/>Subscription price divided by weeks in the billing period. Empty for non-subscriptions.$2.33
<PROD_PRICE_PER_MONTH/>Subscription price adjusted to one month. Empty for non-subscriptions.$9.99
<PROD_PRICE_PER_YEAR/>Subscription price adjusted to one year. Empty for non-subscriptions.$119.88
<OFFER_PRICE/>Localized price of an intro or promo offer. Empty if the user is not eligible for any offer.$0.99
<OFFER_BILLING_PERIOD/>Localized billing period of an offer. Same as <OFFER_FULL_DURATION/> for trial and pay-upfront offers. Empty if the user is not eligible.1 week
<OFFER_FULL_DURATION/>Localized full duration of an offer. Empty if the user is not eligible.1 month

Offer variable values depend on the offer type the user is eligible for. To illustrate, take a weekly subscription called “Premium Subscription” at $5, with three possible offers:

  • Pay As You Go: First 3 weeks for $3 (billed weekly), then $5/week.
  • Pay Up Front: First 3 weeks for $8 (billed immediately), then $5/week.
  • Free Trial: First week free, then $5/week.

In this example, <PROD_TITLE/> returns “Premium Subscription” and <PROD_PRICE/> returns $5. The offer variable values depend on which offer the user is eligible for:

VariablePay As You GoPay UpfrontFree Trial
<OFFER_PRICE/>$3$8$0
<OFFER_BILLING_PERIOD/>1 week3 weeks1 week
<OFFER_FULL_DURATION/>3 weeks3 weeks1 week

For Pay Upfront and Free Trial offers, <OFFER_BILLING_PERIOD/> and <OFFER_FULL_DURATION/> return the same value. For Pay As You Go, they differ because the billing period is one week but the full duration is three weeks.

To learn more about offers and how to configure them, see Offers.

Element variables

Element variables capture the user’s choices — what they selected in quizzes, which tab they are on, and whether the trial toggle is on.

Element variable types depend on the group:

  • Single choice: Single choice quizzes and tabs:
    • selected_id: Element ID to use in conditions
    • selected_title: Element title to use in dynamic text
  • Multi-choice: Multi-choice quizzes:
    • selected_ids: Element IDs to use in conditions
    • selected_titles: Element titles to use in dynamic text
  • Toggle: Trial toggle:
    • is_selected: Boolean value

Common use cases include:

Use variables in text

To insert a variable into a text element:

  1. Select a text element on the canvas.
  2. In the Design tab, find the Content field and write your text.
  3. Click the { } icon in the field.
  4. Select a variable from the list.

You can also use variables in other elements:

  • Use variables in links and alerts to make them dynamic
  • Create dynamic conditions based on variables. For example, the condition can be if experience.current > experience.target, navigate to...
Inserting a variable into a text element