Variables in heyflows are a powerful tool to pass values and customize your flow. One prominent example is personalization. The good news is, it's super simple to make your heyflow personal with variables!
In this example, we're asking for the visitor's first name. On consecutive screens, we would like to reuse this value to address the user.
Step 1: Setting the variable
Select the input field in the content panel so it's highlighted blue. On the left side, at the bottom of the edit panel, you find a section labeled 'Labels & Variables'.
In the field labeled 'Variable', type the name of your new variable. For example, you can use name
, first_name
or username
. You are free to choose the name of this variable. For technical reasons, there are some limitations for the name of variables โ just try it out.
This variable is now available in your flow. In this example, we will continue assuming the name of the variable is firstname
.
Step 2: Using the variable
On any following screen, in a Text or Headline block, you can simply type the symbol @ followed by the name of the variable, e.g. @firstname
. It will be highlighted in blue in the Text field. If it's not highlighted in blue, that means that it will not be replaced.
In Text blocks, the variable will always be highlighted, even if the variable is not set in the first place.
That's it! You can create and use more variables throughout your flow. Just make sure that the @variable
is spelled exactly as you have defined it and that you use the @variable
in a text block.