Rules and pricing

Formulas

Calculate quantities and amounts from your customers' number answers.

Wherever a rule action asks for a number, you can choose formula instead of fixed number. A formula calculates the value from the customer’s answers to your number questions.

What you can write

  • Number question keys, such as openings or linear_feet.
  • Numbers: 2, 0.5, 12.75.
  • Arithmetic: +, -, * (multiply), / (divide).
  • Parentheses to group: (width + 2) * height.

That’s the whole formula language. There are no functions, rounding, or if/else. Use rule checks for conditions, and separate rules for separate cases.

You want Formula
One per opening openings
Two per opening openings * 2
One per opening, plus one spare openings + 1
Square footage width * height
Linear feet with 10% waste linear_feet * 1.1
Half a box per room rooms / 2

Formulas are limited to 200 characters.

Building a formula in the editor

  • Type in the formula box, or use Insert variable to search your number questions and insert one at the cursor.
  • Reads as under the box highlights each question name. An unknown name is marked so you can catch typos.
  • The rule can’t be saved while the formula uses a name that isn’t an active number question.

Things to know

Only number questions work in formulas. Yes/no and pick-one answers can’t be used directly. To charge differently by option, use separate rules with a check on that option, or attach the part directly to the option.

Keys come from the first label. A question’s key is generated from its label when you first save it (“How many openings?” becomes how_many_openings) and never changes after that. For short, readable formulas, create number questions with a short label such as “Openings” or “Width”, save, then change the label to the full wording.

Older questions may have keys with hyphens, like door-width. A formula reads a hyphen as a minus sign, so the rule builder won’t accept those keys. Contact support and we’ll change the key for you.

Unanswered questions stop the formula. If a formula uses a question the customer hasn’t answered yet, or one that’s hidden and empty, the action is skipped and nothing is added. To make a formula always work, make its questions required, or give them a default with a Set default answer rule.

Part quantities round up to whole units. Parts are sold in whole units, so if a formula gives a fraction, the quote rounds it up: openings * 1.5 with 3 openings gives 4.5, billed as 5. The customer sees the rounded quantity and price as they build, and the same numbers are saved on the quote. If you’d rather round differently, pick multipliers that always give whole numbers. Fee and percentage amounts aren’t rounded, so to charge exactly for a measurement like 12.5 linear feet, use Add fee with a formula such as linear_feet * 18.

Customers can’t break it. Formulas only do arithmetic on numbers. The final price is always recalculated on our server when the quote is submitted, so the total a customer submits always matches your rules and prices.