Skip to main content
All CollectionsVariables
Calculations (formulas)
Calculations (formulas)

Add calculations to your headline or text blocks with formulas.

Heyflow avatar
Written by Heyflow
Updated over a month ago

Add calculations to your flow by using variables to assign lead scores to your leads, or to tailor your sales process to each prospect. Whether you need custom offers or ROI calculators, create anything that delivers genuine value to your users.

The Calculation feature presents an excellent opportunity to offer your prospects a helpful tool, fostering increased trust in your brand — a proven method to boost conversion and lead rates.


Setting up calculations

Generally, setting up calculation is pretty easy if you follow these steps:

  1. Highlight the text that you want to turn into a formula

  2. In the toolbar, select “Formula”

  3. Adjust the decimal places, fallback content and system label as needed

💡 Looking for more complex calculations? The entire math.js syntax is supported. If functions should be used, just omit the Math, i.e. Math.min(x,y) needs to be min(x,y) in Heyflow.


Using variables in calculations

If you want to use prefilled content by the user to create a calculation, follow these steps:

  1. The information you want to add as a variable needs to be asked on a screen that comes before your calculation

  2. Use input fields that ask for a numeric value (you might want to consider using a mask to restrict the input to numbers only)

  3. (Set the respective input field as required to make sure the formula will have the necessary values to work with)

  4. Set the variable of the input field

  5. When setting up your formula, type "@variable" to use the respective input field's value in the calculation

💡 Multiple selection, like in multiple choice and picture choice, will result in an addition of the variables, e.g. if your options are 1,2,3,4 and the user selects option 2 & 4, in the calculation it results as a value of 6.

This does not affect the variable replacement in the text.

❗ If you're working with variables, you have to ask for all inputs previous to the calculation screen. At the moment, it doesn't work on one the same screen and would show an error message to the user.


Lead Scoring

You can add calculations to your flow to assign lead scores to your leads by previous inputs, even if they are not numeric, and send them to your integrations for your team to prioritize their leads better.

If you want to give a score to a not numeric input, simply add the value in the system label for each of the options. If you then use that variable, the text gets ignored in the calculation and only the numeric input will be used for the calculation.

❗ In your response, the whole system label including the numeric input will show up, though.


Calculations in responses & integrations

There's one thing to do, if you want to show flow visitors the results of your formula after they submitted their contact information but also want to see them in your response dashboard. Add the formula twice, once before and once after the submit event.

Also, when adding a system label you're able to see the results in your response and map them within our native integrations, such as HubSpot, Salesforce, or Airtable.

If you want to show the calculation only in your response, but not to your flow visitors, simply hide the block under appearance.


Edit options

Option name

Description

Decimal places

How many decimal places should be shown in the results. At the moment, it's only possible to show max. 2 decimal places.

Fallback content

The message that will be shown to flow visitors if the calculation fails

System label

The field label that will be shown in the response dashboard

Did this answer your question?