Formulas and Value Tables let you calculate values based on shoppers' answers, such as product quantities, portion sizes, measurements, or scores. You can display these results in your quiz or use them to personalize recommendations and create more advanced logic.
Choose between a Formula and a Value Table
Both components are available under Components > Advanced in the quiz editor.
Component | How it works | Best for |
Formula | Calculates a number using quiz answers, mathematical operations, and functions | Quantities, measurements, ages, scores, and totals |
Value Table | Looks up a value from a predefined table using two inputs | Size charts, portion guides, and category-based calculations |
Formulas can display results directly to shoppers or calculate values in the background. Value Tables work in the background and return values that can be used elsewhere in your quiz. You can also combine them. For example, a Value Table can determine a recommended daily portion, while a Formula calculates how much product a shopper needs per month.
Create a Formula
Open your quiz in the editor.
Under Components > Advanced, find Formula.
Drag it onto a page after the questions it will use.
Select the Formula component and click Edit formula.
Enter your calculation in the Expression field.
Type @ or use the arrow to insert answers from your quiz into the expression. For example, you could calculate a recommended daily amount using a shopper's entered weight.
Use mathematical functions
The Formula editor includes built-in functions for calculations.
Function type | Available functions |
Rounding |
|
Math |
|
Dates |
|
Conditions |
|
Click a function in the editor to insert it into your expression. You can also use if to create conditional calculations. Click Set condition, choose an input, comparison, and value, then define what the formula should return when the condition is true or false.
Configure rounding and units
Use Decimals to control the precision of your result, or select Full precision to keep all decimal places. You can also add an optional Unit, such as kg, mg, or points.
Note: Rounding affects the saved calculation result, not just how it's displayed. If another calculation uses the result, it receives the rounded value.
Display your formula result
To show the calculated value to shoppers:
Enable Show on page.
Enter your preferred wording in Shown text.
Use
{{result}}where the calculated value should appear.Add Fallback text to display before the required answers are available.
Click Apply.
For example: Your recommended daily portion is {{result}} grams.
If you want to use the result without displaying it, leave Show on page disabled.
Create a Value Table
A Value Table returns a value based on two inputs, such as a shopper's size and activity level.
Open Components > Advanced and add a Value Table after the questions it will use.
Select the component.
Enter a Title and describe What this table does.
Click Edit table.
Step 1: Choose your inputs
Under Which two things does the table read?, select one input for Rows and another for Columns. Inputs can include:
Answers to quiz questions.
Values returned by Image Analysis.
Formula results.
Points.
Results from other Value Tables.
Only inputs available earlier in the quiz can be selected. If you're using a number input, configure its range using Span and divide it into sections using Pieces. You can manually add sections or use Suggest a cut to create ranges automatically.
Step 2: Enter your table values
Click Next: Table and enter the value that should be returned for each combination.
For example, a pet food quiz could calculate daily food portions based on dog size and activity level:
Dog size | Low activity | Moderate activity | High activity |
Small | 80 g | 100 g | 120 g |
Medium | 180 g | 220 g | 260 g |
Large | 300 g | 360 g | 420 g |
Set a Fallback value for answers that don't match any table cell, then click Apply.
These values are illustrative. Use your own product-specific feeding recommendations.
Use calculated values in your quiz
Formula and Value Table results can be used throughout your quiz to create more personalized experiences.
Set product quantities automatically
Use a Formula result to determine how many units of a product should be added to the cart.
For example, a pet food quiz could calculate how many bags a shopper needs each month and automatically prefill the product's quantity selector.
Create a Formula that calculates the required quantity.
Select the Products element on your results page.
Open Per-Product Customization and select the product.
Under Quantity, choose the Formula result.
Test the quantity in Preview.
Product quantities update as shoppers' answers change. If the calculated quantity is invalid or zero, it defaults to 1. The quantity selector's maximum limit still applies. You can also use a fixed quantity or a number entered by the shopper. For more information, see Customize product cards in your quiz.
Create conditional logic
Use calculated values in Visibility Rules or Jump Rules to control what shoppers see. For example, you could display different results pages depending on a calculated score or recommended quantity.
Personalize content
Use Formula and Value Table results in other components, including Smart Copy, to generate content based on calculated values. You can also use the result of one Formula or Value Table as an input for another calculation.
Preview and test your calculations
Before publishing, use Preview to check your calculations with different answer combinations. Make sure that:
Formulas return the expected values.
Value Tables return the correct values for each input combination.
Rounding and units are configured correctly.
Fallback values work when inputs are missing or don't match.
Calculated values are correctly used in logic and product quantities.
Tip: The live result shown while editing a Formula is an estimate based on sample values. Use Preview to test calculations with actual quiz answers.
