Variables in clickflows are a powerful tool to pass values and customize your flow. One prominent example is personalization. In this example, we're asking for the visitor's first name (Figure 1). On consecutive screens, we would like to reuse this value to address the user (Figure 2).
The good news is, it's super simple to make your flow personal with variables!
Figure 1: User input
Figure 2: Using the user input
Step 1: Setting the variable
Select the input field in the content panel so it's highlighted blue (1.). On the left side, at the bottom of the edit panel, you find a section labeled 'System' (2.). For input fields, there are two inputs, 'System label' and 'Variable'.
In the field labeled 'Variable', type the of your new variable. For example, you can use
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
Step 2: Using the variable
On any following screen in any text block, you can simply type the symbol @ followed by the name of the variable, e.g.
@name. It will be highlighted blue in the text field. If it's not highlighted 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.