Formula Builder Guide

Build Powerful Formulas

Create calculated fields and conditional logic using simple formulas. Write calculations to compute values, show or hide fields, and control your forms.

Real-time validation
Auto-suggest field names
Error checking built-in

Two Ways to Use Formulas

Formulas can calculate values to display, or enable/disable things.

Conditions

Show or hide fields and sections, determine what forms are included. When the result is true, the field appears. When false, it stays hidden.

Example 1:

age >= 18 and has_consent

Example 2:

physical_address.state == 'CA'

Include California-specific form section

Returns:

True or false—controls whether the field is shown

Calculated Fields

Compute and display values. Use these to calculate totals, averages, ratings—any value you want to show.

Example 1:

premium = base_rate * multiplier

Example 2:

if(length(description) > 50, 'Long', 'Short')

Categorize by description length

Returns:

Numbers, text, dates—any value to display to the user

What Makes a Condition True?

A field or section appears when its condition evaluates to true. Here's what counts as true:

Comparisons

amount > 1000

True when the comparison succeeds

Text Matching

status == 'approved'

True when text matches exactly

Checkbox Fields

agreed_to_terms

True when the box is checked

Combined with AND

age >= 65 and resident

True when both are true

Combined with OR

has_auto or has_home

True when at least one is true

Reversed with NOT

not opted_out

True when the value is false

Positive Numbers

total_count

True when number is greater than zero

Text With Value

middle_name

True when text has any value

Date Provided

date_of_birth

True when date has a value

Operators

The building blocks of your formulas.

Math

+

Add

a + b
-

Subtract

a - b
*

Multiply

price * quantity
/

Divide

total / count
%

Remainder

year % 4 == 0
^

Power

base ^ 2

Compare

==

Equal

status == 'done'
!=

Not Equal

type != 'exclude'
>

Greater Than

score > 80
<

Less Than

age < 65
>=

Greater or Equal

amount >= 100
<=

Less or Equal

years <= 5
in

Contains

'red' in colors

Logic

and

Both must be true

age > 18 and has_consent
or

At least one true

type == 'A' or type == 'B'
not

Reverse condition

not exempt
? :

Conditional

score > 90 ? 'A' : 'B'

Common Mistake: One Equals vs Two Equals

When comparing values, always use two equals signs (==).

Wrong—This sets a value:

status = 'approved'

This assigns 'approved' to status instead of checking if it matches

Correct—This compares values:

status == 'approved'

This checks if status equals 'approved'

Built-in Functions

Ready-to-use functions for common calculations. No need to build these from scratch.

Math & Rounding

round(number, decimals)

Round to specific decimals

round(price, 2)

roundTo(number, places)

Round to decimal places

roundTo(total, 2)

floor(number)

Round down to whole number

floor(amount)

ceil(number)

Round up to whole number

ceil(rating)

trunc(number)

Remove decimal part

trunc(3.9) → 3

abs(number)

Absolute value (positive)

abs(profit_loss)

sign(number)

Sign: -1, 0, or 1

sign(balance)

max(a, b, ...)

Largest of all values

max(score1, score2, score3)

min(a, b, ...)

Smallest of all values

min(price, 100, cost)

pow(base, exp)

Raise to power

pow(length, 2)

sqrt(number)

Square root

sqrt(area)

cbrt(number)

Cube root

cbrt(volume)

hypot(a, b)

Distance formula (√a²+b²)

hypot(width, height)

Advanced Math

ln(number)

Natural logarithm

ln(revenue)

log10(number)

Base-10 logarithm

log10(value)

exp(number)

Exponential (e^x)

exp(rate * time)

random(max)

Random number 0 to max

random(100)

Conditional & Logic

if(condition, yes, no)

Choose based on condition

if(score > 90, 'A', 'B')

not(value)

Reverse true/false

not(opted_out)

Text & Lists

length(text)

Count characters or items

length(description)

indexOf(text, search)

Find position of text

indexOf(email, '@')

indexOf(item, list)

Find item in list (-1 if not)

indexOf('red', colors)

join(list, separator)

Combine list into text

join(tags, ', ')

Common Patterns

Start with these frequently-used examples. Each one shows a practical business calculation.

Basic Math

Use standard math operators

price * quantity

Multiply two fields

(subtotal + tax) * 1.1

Calculate with markup

revenue - expenses

Simple subtraction

radius ^ 2 * PI

Circle area (πr²)

Comparisons

Test values against each other

amount > 1000

Is amount over 1000?

status == 'approved'

Does status equal approved?

score >= 90

Is score 90 or higher?

'urgent' in tags

Is 'urgent' in the tags list?

Conditional Logic

Make decisions based on your data

amount > 1000 ? 'High' : 'Low'

Categorize by amount

rating >= 4 ? 'Premium' : 'Standard'

Classify by rating

if(year % 4 == 0, 'Leap Year', 'Common Year')

Check for leap year

Built-in Functions

Ready-to-use calculations

round(total, 2)

Round to 2 decimals

max(value1, value2, value3)

Find the largest

abs(profit_loss)

Absolute value

trunc(price)

Remove decimals

Working with Lists

Check if items exist in lists

'approved' in statuses

Is status in list?

length(items) > 0

List has items?

indexOf('red', colors) >= 0

Find item position

Working with Objects and Lists

Your data model can organize fields as objects (groups of related data) or lists (groups of items). Access them using dot notation.

Objects (Related Data)

Group related fields together. Use dot notation to access nested values.

Data Model Structure:

applicant
  ├── firstName
  ├── lastName
  └── email

Access in formulas:

applicant.firstName

Example usage:

if(applicant.firstName == 'John', 'Hello John', 'Welcome')

Lists (Groups of Items)

Collect multiple items. Use functions to count, search, or work with the list.

Data Model Structure:

beneficiaries
  └── (list of names)

Count items:

length(beneficiaries)

Check if list has items:

length(beneficiaries) > 0

Get a specific item:

beneficiaries[0]

Gets first item (positions start at 0)

Get the fourth item:

beneficiaries[3]

Position 3 gets the fourth item

Combined Example

Use nested data to build meaningful conditions and calculations.

Scenario: Show a question only if the primary applicant is under 65

applicant.age < 65

Scenario: Calculate total coverage from all properties in a list

properties.coverage_primary + properties.coverage_secondary

Scenario: Require additional info when there are multiple beneficiaries

length(beneficiaries) > 1

Real-World Examples

See how formulas solve common business problems.

Insurance Premium Calculation

Calculate total premium with base rate, adjustments, and tax

Fields used:

base_rateadjustment_factortax_rate

Formula:

(base_rate * adjustment_factor) * (1 + tax_rate)

Risk Classification

Categorize applicants by risk score

Fields used:

risk_score

Formula:

if(risk_score >= 80, 'High Risk', if(risk_score >= 50, 'Medium Risk', 'Low Risk'))

Discount Eligibility

Check if customer qualifies for multi-line discount

Fields used:

has_autohas_homehas_life

Formula:

(has_auto and has_home) or (has_auto and has_life) or (has_home and has_life)

Age-Based Pricing

Apply age bracket pricing multiplier

Fields used:

base_priceage

Formula:

base_price * if(age < 25, 1.5, if(age < 65, 1.0, 1.2))

Total Coverage

Sum all coverage amounts

Fields used:

property_coverageliability_coveragecontents_coverage

Formula:

property_coverage + liability_coverage + contents_coverage

Commission Calculation

Calculate agent commission with tiered rates

Fields used:

premium_amount

Formula:

premium_amount * if(premium_amount > 10000, 0.15, if(premium_amount > 5000, 0.12, 0.10))

Status Validation

Check if application is in a valid status

Fields used:

status

Formula:

'approved' in statuses or 'pending' in statuses

Circle Area Calculation

Calculate area from radius using π

Fields used:

radius

Formula:

PI * radius ^ 2

Leap Year Check

Determine if a year is a leap year

Fields used:

year

Formula:

year % 4 == 0

Pro Tips

Expert advice to write better formulas faster.

Use Field Names Directly

Reference any field by its name - no special syntax needed. Just type the field name exactly as it appears in your data model.

total = price * quantity

Text Values Need Quotes

When comparing to or returning text, wrap it in single quotes. Numbers don't need quotes.

status == 'active' or amount > 1000 ? 'High' : 'Low'

Parentheses Control Order

Use parentheses to control which calculations happen first.

(base + bonus) * tax_rate

Combine Conditions

Use 'and'/'or' to test multiple conditions together. Parentheses help group complex logic.

(age >= 65 or disabled) and resident

Check List Membership

Use the 'in' operator to check if a value exists in a list. Returns true if found.

'urgent' in tags or 'approved' in statuses

Use Remainder for Patterns

The % operator gives the remainder. Great for detecting even/odd or finding multiples.

year % 4 == 0 (leap year) or value % 2 == 0 (even number)

Choose Between if() and ? :

Both do conditionals. Use if() for clarity, use ? : for simple inline choices.

if(score > 90, 'A', 'B') vs score > 90 ? 'A' : 'B'

Pick the Right Rounding

round() rounds to nearest, floor() always down, ceil() always up, trunc() chops decimals.

floor(3.9) = 3, ceil(3.1) = 4, trunc(3.9) = 3

Ready to Build?

Start creating calculated fields in your forms. The formula editor will guide you every step of the way.

Go to Dashboard