Skip to main content

Set Variables from URL

Pass values to your flow via URL parameters.

Updated over a week ago

To make your flow even more dynamic, you can pass information to your flow from the URL and use them throughout your flow via variables, such as personalization with names, IDs, sources of where the customer came from, etc.

🔎 Also, check out our help articles about URL/UTM parameters in general. If you're looking for more information on how to pass parameters to a URL from your heyflow, take a look here.


Setup

Step 1: Setting the variable

  1. To add a variable to your input blocks, head to the edit section of your flow.

  2. Select an input block (like input field or picture choice) in the content panel. Now, it's highlighted blue and you can see the settings of the block.

  3. At the bottom of the edit panel, you find a section labeled 'Labels & Variables'.

  4. In the field labeled 'Variable', type the name of your new variable. For example, you can use name, first_name or username.

  5. In some cases your input block offers different options to answer. In this case you can set up different variables for the different answer options.

  6. After confirming you entry with enter, your variable is now available in your flow for further use.

❗ For technical reasons, there are some limitations for the name of variables, e.g. a space between words is not allowed. Learn more about limitations here.

Step 2: Add variable to URL

After you successfully set up variables to input values of your flow, you can start to actually include them to the URL of your flow.

To pass values to your flow via the URL, you simply need to:

  1. Type a question mark ? after the flow ID.

  2. Followed by the variable name.

  3. Then an equal sign =.

  4. And finally, the value itself.

Example

You may already know some relevant information about your user. In this example, we know the name of the dog: Barker. Therefore, our variable is dog_name.

Then the following URL passes the variable dog_name with the value Barker automatically to the flow: https://heyflow.id/flow-id?dog_name=Barker.

Important: URL Parameters must be added after the heyflow ID and before the #screen.

✅ Correct: heyflow.id/my-flow-id?dog-name=Barker#screen

❌ Wrong: heyflow.id/my-flow-id#screen?dog-name=Barker

🔎 When you want to pass multiple parameters to your flow, you can easily do so by inserting & between the parameters, e.g.

https://heyflow.id/myflowid?firstname=@firstname&email=@email

or with a custom domain:

https://yourdomain.com?firstname=@firstname&email=@email

❗ Important: Users might update the URL and parameters can be manually deleted.


Examples

Personalizing flows with variables

Personalization is one of the most effective ways to make your flows feel more relevant, engaging, and user-friendly. With variables, you can tailor the experience based on what you already know about the user, whether it’s their name, location, or other details.

Example: If you're running location-specific campaigns, such as job ads or services in multiple cities, you can personalize your flow headline or questions using a location variable passed via the URL.

  • A visitor lands on your flow with the link ?city=Berlin.

  • You can use a variable like @city in your text to say: "Looking for a new job in @city?"

  • Which will be displayed as: “Looking for a new job in Berlin?”

  • This makes your messaging more targeted and boosts engagement.

Pre-filling contact details

If you already have the user’s contact details from a previous interaction (e.g. from an email campaign or CRM), you can pass them into the flow via URL parameters like ?first_name=Anna&[email protected]. When the user opens the flow:

  • Input fields can be pre-filled automatically.

  • You can greet them by name in your headline or text (e.g. “Welcome back, @first_name!”).

  • They won’t need to re-enter the same data again and therefore improving user experience and conversion rates.

Pass hidden values

You might also want to pass values that are internal and should not be shown to the user – but still included in the response that you receive via email or another response handler. To achieve this, you set up the input and variable in the same manner as above and simply hide the block.

For example, you might know the email address to identify the user. You can create an input field with the variable email and hide the block. This way, the value will not be shown to the user, but it will be included in the response to you. Here, too, you can pass the value as a variable to your flow as a URL parameter like this: [email protected]

Did this answer your question?