Variables and Field Values

Written By Floris de Vries

Last updated 3 days ago

Variables represent values that can be used inside pricing formulas. These values come from form fields, product data, or system helpers.


Form field variables

Every field created in Step 1 becomes available as a variable in the formula.
The variable name is based on the fieldโ€™s Key (unique ID).

How field types behave

  • Number Input
    Uses the numeric value entered by the customer

  • Dropdown / Radio / Swatch
    Uses the numeric value of the selected option

  • Checkbox
    Uses the numeric value when checked, otherwise 0

  • Text Field
    Does not directly affect pricing, but can be referenced in logic

  • File Upload
    Uses the numeric value defined in the field settings

All values update dynamically based on customer input.


Product & variant variables

You can include product pricing directly in your formula.

Product price

The Product price variable always represents the price of the currently selected variant.

  • If the product has multiple variants, this value updates automatically when the customer selects a different variant.

  • If the product has only one variant, the product price is simply the base product price.

In practice, Product price always equals the active variant price.


System helpers

The calculator includes helper values for rounding and logic:

  • ROUND_UP โ€“ Rounds a value up

  • ROUND_DOWN โ€“ Rounds a value down

  • ROUND_TO_NEAREST โ€“ Rounds to the nearest whole value

The following helper values are only available when using Conditional Formulas (Premium):

  • TRUE / FALSE โ€“ Boolean values used for conditional logic in pricing rules

These helpers are not customer inputs but calculation tools.


Variable rules

  • Variable names are case-sensitive

  • Variables must exist in the calculator

  • All values used in formulas must be numeric

  • Invalid variables will cause the formula to fail


๐Ÿ’ก Tip:
Use clear, descriptive field keys. This makes formulas easier to read, debug, and maintain.