Using Tables in Formulas

Using Tables in Formulas

Overview

The TABLE() function lets you look up values from your pricing tables directly inside calculator pricing formulas. Instead of writing complex conditional logic, you pass in the table name and one or two keys, and the function returns the matching value. This keeps your formulas clean and your pricing data easy to maintain separately. You can use TABLE() in any formula field throughout Calculator Editor → Options & Pricing.

Quick Reference

Syntax Description
TABLE("name", key) One-column lookup — returns the value for the matching key. Works for key→value tables and single-column grids.
TABLE("name", key, "Price") Same lookup with an explicit column key (use your value-column header if it is not Price).
TABLE("name", rowKey, colKey) Multi-column lookup — returns the value at the intersection of the row and column keys.
TABLE("name", rowKey, colKey, "mode") Lookup with an explicit mode override as the fourth argument.

One-column lookup (key → value)

TABLE("tableName", key)

tableName is the exact name of your pricing table (in quotes). key matches the values in the blue column of the grid.

For one-column tables you can omit the column key. Appify uses the sole non-empty green header in the value column (commonly Price). You may also pass it explicitly:

TABLE("tableName", key, "Price")

Grid layout

           | Price
-----------+-------
WOOD       | 2.50
ACRYLIC    | 4.00
METAL      | 6.50
  • Blue column = Choice Token lookup keys (match OPT_TOKEN / HAS, not display labels)
  • Green header of the value column (Price) = TABLE column key
  • Top-left cell = optional label (not a lookup key)

Multi-column lookup (two keys)

TABLE("tableName", rowKey, colKey)

rowKey matches the blue column. colKey matches a green header-row column key. Either key can be numeric (INPUT) or a Choice Token (OPT_TOKEN).

Grid layout

     | VINYL | PAPER
-----+-------+------
12   | 10    | 8
24   | 18    | 14
  • Blue column = row keys (here: numeric sizes)
  • Green header row = column keys (here: material Choice Tokens)
  • Formula: TABLE("sheet_prices", INPUT("SIZE"), OPT_TOKEN("MATERIAL"))

Lookup Modes

The lookup mode controls how keys are matched. Each table has a default mode set when you create it. You can override it per call by passing a fourth argument:

TABLE("name", rowKey, colKey, "nearestLower")

For one-column tables with an explicit column key:

TABLE("qty_rates", INPUT("QTY"), "Price", "nearestLower")
Mode Value Behavior
Exact match "exact" Returns the value only when the key matches exactly.
Nearest lower "nearestLower" Finds the closest key that is less than or equal to the input.
Nearest upper "nearestUpper" Finds the closest key that is greater than or equal to the input.
Nearest "nearest" Finds the closest key in either direction.
Interpolate "interpolate" Linearly interpolates between the two nearest keys on one-column / pair tables. Numeric keys only. Not implemented for multi-column grids yet.

Preferred: put the mode in the fourth argument.
Compatibility: on one-column / key→value tables, TABLE("qty_rates", INPUT("QTY"), "nearestLower") is also accepted (the mode-shaped third argument is treated as a mode override). On multi-column grids the third argument is always a column key, so use the four-argument form.

Details

  • The returned value is a number, so you can combine it with arithmetic: TABLE("materials", OPT_TOKEN("MATERIAL")) * VAR("AREA").
  • For dropdown/radio/button/swatch lookups, pass OPT_TOKEN("KEY") and put Choice Tokens (not labels) in the table as lookup keys — the blue column (one-column keys or multi-column row keys) and/or the green header row (multi-column column keys). OPT("KEY") is the option's numeric price contribution, not the selected choice name. String key matching is case-insensitive (one matches ONE).
  • Pass option references as keys so the lookup is dynamic based on customer selections.
  • Make sure the pricing table exists on the Pricing Tables page and has data before referencing it in a formula.
  • You can reference both per-calculator tables (created in the calculator editor) and global tables (created on the main Pricing Tables page).
  • Multi-column tables require both rowKey and colKey. Omitting colKey only works when the table has exactly one value column.

Examples

  • Material cost formula — Your calculator has a dropdown option called MATERIAL. Your table has Choice Token keys WOOD / ACRYLIC / METAL in the blue column and a Price column. Your formula is TABLE("materials", OPT_TOKEN("MATERIAL")) * INPUT("QUANTITY"). When a customer selects Acrylic (ACRYLIC), the function looks up that rate and multiplies it by the quantity.
  • Size × material sheet pricing — Your calculator has a numeric SIZE input and a MATERIAL dropdown. Green header columns use material Choice Tokens (VINYL, PAPER). Your formula is TABLE("sheet_prices", INPUT("SIZE"), OPT_TOKEN("MATERIAL")).
  • Size-based sheet pricing — Your calculator has WIDTH and HEIGHT number inputs. Your formula is TABLE("sheet_prices", INPUT("WIDTH"), INPUT("HEIGHT")). The multi-column table returns the price for the selected width and height combination.
  • Nearest-lower rate lookup — You have a one-column table of quantity breaks (10, 25, 50, 100) mapped to per-unit rates under a Price header. Your formula is TABLE("qty_rates", INPUT("QTY"), "Price", "nearestLower"). A customer entering 30 units gets the rate for 25 (the nearest key ≤ 30). If the table has only that one value column, TABLE("qty_rates", INPUT("QTY")) also works when the table mode is already Nearest lower.
    • Related Articles

    • Pricing Tables

      Overview Pricing tables are reusable lookup tables that store pricing data outside of your calculator formulas. Instead of hardcoding prices or building complex nested conditions, you define your data in a table and reference it from any calculator's ...
    • Pricing Variables

      Overview Pricing variables are named, computed values that act as intermediate steps in your pricing logic. Instead of writing one large formula, you can break the calculation into smaller, readable pieces — each stored as a variable — and reference ...
    • Weight Calculation

      Overview Weight calculation lets you define a formula that computes a product's shipping weight based on customer selections. The calculated weight is saved with the order so your shipping provider can use it to quote accurate rates. You configure it ...
    • Price Adjustments

      Overview Price adjustments are conditional rules that modify the calculated price when certain conditions are met. Each adjustment combines one or more conditions with a formula, letting you add surcharges, apply multipliers, or set overrides based ...
    • How Pricing Works

      Overview Appify CPO uses a multi-stage pricing pipeline to turn customer selections into a final price. Each stage feeds into the next, so you can build pricing as simple or as complex as your product requires — from a flat price to formulas that ...