BXL · syntax reference
Playground

BXL Syntax Reference

BXL — the Boxel Expression Language. Readable labels, one-based rows, predicates, and positional selectors on top of jq pipes and 300+ Excel formula helpers. Compiles to canonical jq; same evaluator, same AST, one language.

BXL is how you write. jq is what the engine runs. Every BXL expression desugars to canonical jq before evaluation — one tokenizer, one parser, one sandboxed evaluator.

field paths jq builtins Excel formulas operators variables strings

Core Mental Model

If you know spreadsheets, you know the core idea. The difference: instead of cell references like A1:B10, you work with JSON -- fields, arrays, and objects.

SpreadsheetBXL (readable, with sugar)
Cell valueJSON scalar (number, string, boolean)
Range A1:A10Array field — navigate it as "Line Item" or materialize with "Line Item"[all]
Table with headersArray of objects — each object's keys are the columns (Quantity, "Unit Price", …)
Current row. (the dot — current JSON value inside map/select)
=A1 + B1Price + Tax
=SUM(A1:A10)SUM("Line Item".Amount)  — implicit iteration, no map needed
=IFERROR(A1, 0)IFERROR(Value, 0)
=SUMIF(C:C, "Service", B:B)SUM("Line Item"[*Category = "Service"].Amount)
=VLOOKUP(E2, A:B, 2, FALSE)"Line Item"[SKU = Target SKU]."Unit Price"  — first-match predicate
=A1 (first row)"Line Item"[#first].Amount
=INDEX(A:A, ROWS(A:A)) (last)"Line Item"[#last].Amount
=ROUND(B1*C1, 2)ROUND(Quantity * "Unit Price", 2)
Notice what changes between Excel and BXL: no cell letters (A1), no absolute columns (A:A), no separate ROWS() to get the last position. Every row shows a different piece of sugar in action — labels replace cell references, implicit iteration replaces map, [*pred] replaces SUMIF, first-match [pred] replaces VLOOKUP, and positional selectors replace INDEX/ROWS arithmetic.
Commas for readable calls, semicolons for jq. Built-in Excel formulas take commas to match spreadsheet paste: ROUND("Unit Price", 2), SUM(a, b, c). BXL-readable helpers and validator.js functions also take commas: when(condition, result), isURL(Website, {require_protocol:true}). BXL rewrites those comma-separated argument lists to jq's ; form during compile so the runtime sees valid jq — that rewrite happens under the hood; ROUND("Unit Price"; 2) is not paste-compatible with Excel and is not a form authors write. User-defined jq def helpers use ; at both the definition (def clamp(lo; hi; x): …) and the call (clamp(0; 100; .score)).
Array literals also use commas: [1, 2, 3].

Naming convention: UPPERCASE is Excel, lowercase is BXL-native

Every helper name in BXL follows one of two conventions. The compiler is case-insensitive (ROUND, round, and Round all resolve to the same function), but the convention communicates intent to the reader.

Reader seesInterpretationExamples
UPPERCASEReal Microsoft Excel function — paste-compatible, matching semantics. We never invent new UPPERCASE names.ROUND, SUM, IFERROR, VLOOKUP, ISBLANK
lowercaseBXL-native contribution — jq ecosystem primitive or a BXL-specific shortcut. Not portable to Excel.present, when / implies, words, nonempty, map, select, add
If a helper name is UPPERCASE, you can paste it into an Excel cell and expect the same answer. If it's lowercase, it's BXL's own vocabulary. The convention is enforced socially in review, not by the compiler — but keep it honest in authored expressions so reviewers can trust the promise.

Core Top 10 things to remember

If you only remember ten things about BXL, remember these. Every other section expands on one of them.

#RuleIn practice
1 Labels replace paths in schema-aware contexts. "Line Item".Quantity, not .lineItems[].quantity. Write what the UI shows. The compiler resolves display names via the active schema.
2 Implicit iteration on array fields. Navigating .field on an array auto-materializes. SUM("Line Item".Amount) — no map, no [all]. Sugar beats boilerplate.
3 One-based rows use [#N]; raw [N] is 0-based jq. They mean different elements. [#4] = 4th row. [3] = 4th row but zero-based (escape hatch). Pick one style per expression.
4 Predicates come in two shapes. [pred] returns the first match; [*pred] returns every match. Scalar vs array result. [SKU="X"] finds one; [*Taxable] filters all.
5 Excel-style equality works: = and <> compile to == and !=. Paste IF(Status="paid", …) from Excel, no edits needed.
6 UPPERCASE is a promise. ROUND, SUM, ISBLANK match Microsoft Excel exactly. lowercase (present, when, words) is BXL-native. UPPERCASE paste-compatible with Excel cells. lowercase is BXL's own vocabulary.
7 Positional selectors live in [#...] only. Positive selectors are 1-based; last-relative selectors count backward from the end. [#1], [#4], [#first], [#last], [#last-1], [#4..#last-3], [#1, #2, #7..#9, #11], [#odd], [#even], [#only].
8 Root auto-binds across pipes. Readable labels after | resolve against the root card, not the piped-in value. "Line Item"."Line Total" | add = Subtotal — Subtotal reads from the root.
9 Presence is context-dependent. ISBLANK is Excel-strict (null only). present is form-friendly (null or ""). present(Email) for form validation. NOT ISBLANK(Email) when you need Excel's semantics.
10 Formatters pipe and interpolate. | @fmt transforms a value; @fmt "… \(expr) …" escapes every interpolation into a safe sink. @html "Hi \(Name)" escapes XSS. @uri for URLs. @json / @csv / @base64 for machine sinks.
Honorable mentions. when(p, q) / implies(p, q) for "if this, then that must hold" constraints. nonempty(arr) to strip null / "" before counting. words(s) to count whitespace-separated tokens.

BXL Readable Paths

BXL keeps canonical jq valid and adds a schema-aware readable layer. Labels, one-based rows, predicates, and positional selectors compile to the same AST shape the jq evaluator already understands.

Runtime shape: BXL is a compiler front-end for jq. It rewrites readable source to canonical jq, then uses the same tokenizer, parser, evaluator, formula helpers, validator.js functions, and jq builtins. Async runtimes (runNativeJqAsync, prepareNativeJqAsync, prepareBoxelRuntimeAsync) also inspect expressions and lazy-load large FormulaJS extension libraries and validator.js functions only when referenced. Sync evaluators use the eager formula core unless a lazy library is explicitly registered — in a card's computeVia the lazy families are already available, see Computed Fields.

Labels, rows, and implicit iteration

Readable BXLCanonical jqMeaning
Total.totalBare labels work when the schema resolves them unambiguously.
"Bill To"."Country Code".billTo.countryCodeQuoted labels handle spaces and punctuation.
"Line Item"[#4].Quantity.lineItems[3].quantity[#N] is the canonical one-based row shortcut.
"Line Item"[#1..#3].SKU[.lineItems[0:3][].sku]One-based inclusive range — first three SKUs.
"Line Item"."Line Total"[.lineItems[].lineTotal]Implicit iteration — navigating .field on an array field auto-materializes, just like [all].
"Line Item"[all].Quantity[.lineItems[].quantity]Explicit form remains valid.
Legacy row shortcuts. [row N] and [item N] still parse but solidify rewrites them to [#N]. Keep [0] / [0:3] (zero-based, jq-native) as the escape hatch when you need it.
Range translation is intentional. The preferred readable spelling is [#4..#6]: inclusive, one-based rows 4, 5, 6. jq slices are zero-based and the end is exclusive, so the correct lowering is [3:6], not [3:5]. Shorter [#4..6] remains accepted as an alias.

Predicates: first-match and filter-all

Readable BXLCanonical jqShape
"Line Item"[SKU = "COPY-04"].Quantityfirst(.lineItems[] | select(.sku == "COPY-04")).quantityFirst match — scalar result.
"Line Item"[*Category = "Service"][.lineItems[] | select(.category == "Service")]Filter all — [*pred] keeps every matching row.
SUM("Line Item"[*Taxable]."Line Total")SUM([.lineItems[] | select(.taxable).lineTotal])Excel SUMIF shape — no dedicated _BY builtin needed.
COUNTA("Line Item"[*Quantity > 5])COUNTA([.lineItems[] | select(.quantity > 5)])Excel COUNTIF shape.
"Line Item"[*Quantity * "Unit Price" > 15].SKU[.lineItems[] | select(.quantity * .unitPrice > 15).sku]Arbitrary boolean predicate — arithmetic across sibling fields.
"Line Item"[SKU | startswith("BRAND")]first(.lineItems[] | select(.sku | startswith("BRAND")))String predicates use jq pipe form.
Predicate truthiness. [*Taxable] (bare field) uses Excel truthy semantics — true keeps, false / null / missing filter out — same as jq's native select(.taxable).

Positional selectors

Readable BXLCanonical jqNotes
"Line Item"[#first].SKU.lineItems[0].skuFirst item.
"Line Item"[#last]."Line Total".lineItems[-1].lineTotalLast item.
"Line Item"[#last-1].SKU.lineItems[-2].skuSecond from the end.
"Line Item"[#4].Quantity.lineItems[3].quantityPositive selectors are 1-based.
"Line Item"[#2..#last-1].SKU[(.lineItems) as $__seq | $__seq[1:(($__seq | length) - 1)][].sku]Forward anchored range from the front to the back.
"Line Item"[#last-3..#last-1].SKU[(.lineItems) as $__seq | $__seq[(($__seq | length) - 4):(($__seq | length) - 1)][].sku]Forward anchored range fully from the back.
"Line Item"[#1, #2, #7..#9, #11].SKU[(.lineItems) as $__seq | ($__seq | length) as $__len | range(0; $__len) as $__idx | select($__idx == 0 or $__idx == 1 or ($__idx >= 6 and $__idx < 9) or $__idx == 10) | $__seq[$__idx].sku]Selector union. Output stays in collection order and overlaps collapse naturally.
"Line Item"[#-1].SKU.lineItems[-1].skujq-native alias for the last item.
"Line Item"[#odd][.lineItems | .[range(0; length; 2)]]Positions 1, 3, 5 (1-based).
"Line Item"[#even][.lineItems | .[range(1; length; 2)]]Positions 2, 4, 6.
Shipment[0:1][#only].Carrier(([(.shipments[0:1][])] ) as $__seq | ($__seq | length) as $__len | if $__len == 1 then $__seq[0] else error(...) end).carrierThe only element, error unless length is exactly 1.
Indexing asymmetry is intentional. Positive selectors are 1-based ([#1] is the first row) because they are for human-authored row access. The preferred end-relative form is [#last-N]: [#last] is the last row, [#last-1] second-to-last, [#last-3] fourth-from-last. jq-native [#-N] aliases are still accepted ([#-1] = [#last], [#-2] = [#last-1]) but the readable formatter prefers the last-N spelling.
Anchored ranges are forward-only. [#4..#last-3], [#first..#last], and [#last-119..#last-1] are valid because they still move left-to-right in collection order. Reversed anchored ranges such as [#last-3..#4] or [#last-1..#last-119] are rejected instead of implying reverse traversal.
Selector unions are set-like. [#1, #2, #7..#9, #11] means “include these positions.” The result always comes back in collection order, not textual order, and overlapping terms do not duplicate rows.
Boolean size checks are regular expressions now. CSS-style :only, :empty, :not, :has, :is, and :where are gone. Use normal BXL instead: (X | length) = 0, (X | length) = 1, select(not ...), has("x"), or explicit or chains.

Formula composition

Readable BXL · Excel-style comparisons
ROUND(Subtotal * "Tax Rate" / 100, 2) = "Tax Amount"
Canonical jq · runtime form
ROUND(.subtotal * .taxRate / 100; 2) == .taxAmount
Equality is Excel-style in readable BXL. Use = for equality and <> for inequality everywhere — top-level, inside [pred], [*pred], all(…), any(…), IF(…). Both == / != still parse as input; the canonicalizer rewrites. Compiled jq keeps == / != because jq requires them at runtime.
Root-scope across pipes is automatic. BXL detects readable labels that appear after a top-level pipe and auto-binds the root via . as $root. You can write "Line Item"[all]."Line Total" | add == Subtotal without parentheses — it compiles to . as $root | [.lineItems[].lineTotal] | add == $root.subtotal. Explicit jq paths (.subtotal) still mean "read from the current piped input"; readable labels mean "read from the root."

Grammar and linter

ArtifactPurpose
grammar.ebnfStandalone formal grammar for the BXL readable-syntax overlay.
syntax/bxl.tmLanguage.jsonPortable TextMate syntax highlighting definition for BXL expressions.
lintBxlExpression(source, options)Non-evaluating linter for readable syntax confusion, compiler warnings, and native parse errors.
tests/linter-cli.tsCLI coverage for edge cases the grammar allows but authors can easily misread.
Lint targets: missing quotes around multi-word labels, root labels after a top-level pipe, legacy [row N] shortcuts, predicate selectors that return only the first match, top-level == (info-level prefer-excel-equality — BXL canonicalizes to =), removed CSS-style pseudo-classes, and helper-dependent predicates such as IN.
Forgiving text fields: BXL accepts extra whitespace, mixed capitalization for readable keywords/selectors/predicates/positional-selector keywords, lowercase or mixed-case formula function names, comma-separated or semicolon-separated formula arguments, uppercase booleans, and unquoted multi-word labels when the schema resolves them unambiguously. The canonical compiler output still normalizes to jq.

BXL Excel Paste Compatibility

BXL absorbs five Excel-specific idioms so a formula from a spreadsheet works verbatim:

Excel idiomWhat BXL doesExample
Leading = (cell-formula prefix)Stripped by the preprocessor.=ROUND(x, 2) → ROUND(x, 2)
<> inequalityCanonicalized to != for jq; displayed as <> in readable BXL.Status <> "closed"
^ power operatorRight-associative rewrite to POWER(a, b).2^8 → POWER(2, 8)
& string concatRewrite to ((a|tostring) + (b|tostring)) — Excel-style coercion."Invoice-" & "Invoice Number"
Unknown charactersCaught by the linter as untokenizable-character; never crashes solidify.—
Paste test: Sampled FormulaJS cases across math/trig, text, logical, statistical, engineering, information, date/time, and financial formulas work unchanged in the async compatibility runtime. Known paste gap: MODE is not implemented, and AND / OR / XOR use array-style arguments.

BXL Interesting Patterns

Compact idioms that showcase how labels, [*pred], implicit iteration, and Excel operators braid together. Each one-liner replaces 5–10 lines of imperative TypeScript.

Excel SUMIF / COUNTIF without the _BY builtin

Conditional sum
SUM("Line Item"[*.Taxable]."Line Total")
Conditional count (with explicit predicate)
COUNTA("Line Item"[*.Category = "Service"])
Average with a numeric predicate
AVERAGE("Line Item"[*.Quantity > 2]."Line Total")
Predicate with arithmetic across sibling fields
"Line Item"[*.Quantity * "Unit Price" > 15].SKU

Self-auditing constraints

Stored tax matches computed tax
ROUND(
  SUM("Line Item"[*.Taxable]."Line Total") * "Tax Rate" / 100,
  2
) = "Tax Amount"
Subtotal matches line-item aggregate (root-scope across pipe)
"Line Item"."Line Total"
| add = Subtotal
Payments cover balance
Total - SUM(Payment[*.Status = "captured"].Amount)

Policy predicates with all / any

Every step complete
all(Step[], Status = "done")
Any shipment outstanding
any(Shipment[], Delivered = false)
No payments overdue
all(Payment[], "Days Late" = 0)

Named rows, the human way

First / last
"Line Item"[#first].SKU&" through "&"Line Item"[#last].SKU
One-based shortcut
"Line Item"[#4].SKU
Inclusive range
SUM("Line Item"[#1..#3]."Line Total")

Excel-style string composition with &

Build a display string
"Invoice-"&"Invoice Number"&" ("&Status&")"
Coerces numbers to strings automatically
Customer.Name&" ("&Customer.Tier&") has "&(COUNTA("Line Item") | tostring)&" items"

Visibility / gate checks without pseudo-classes

Reveal reviewer section
Status = "in-review"
Empty check
(Payment[*.Status = "failed"] | length) = 0
Unique match
"Line Item"[*.Category = "Service"][#only]

Multi-line analytics pipeline

Category rollup — written in a textarea, collapses to one line on demand
"Line Item"[all]
| group_by(.Category)
| map({
    category: .[0].category,
    total: (map(.lineTotal) | add)
  })
Toggle via the workbench. expandBxlExpression wraps at pipe boundaries and multi-arg function calls when the inline length exceeds 40 chars; collapseBxlExpression round-trips back to the canonical single-line form.

Excel operators ^ and & paste unchanged

Power
ROUND(Principal *(1 + Rate)^Years, 2)
Inequality + power combined
IF ("Year End" <> "Start Year", 2^8, 0)

Use Use Cases

Eleven real-world patterns that combine readable labels, jq pipelines, and Excel-style formulas. Each one falls apart without all three. Expressions below are idiomatic BXL (equality is =, inequality <>); the canonical jq form is available through the workbench.

1 · Invoice integrity auditor

Prove line items sum to the stored subtotal, tax applies only to taxable items, the grand total recomputes from parts.

Sum check
("Line Item"[all]."Line Total" | add) = Subtotal
Total recompute
ROUND(
  Subtotal - "Discount Amount" + "Tax Amount" + Shipping,
  2
) = Total
Taxable-only tax
ROUND(
  (
    "Line Item"[*.Taxable]."Line Total" | add
  ) * "Tax Rate" / 100,
  2
) = "Tax Amount"
Per-item consistency
all(
  "Line Item"[],
  "Line Total" = Quantity * "Unit Price" - Discount
)

2 · Gradebook — weighted averages and letter grades

Category averages × weights, plus threshold-based letter assignment. Flag missing work.

Weighted total
ROUND(
  AVERAGEIF_BY(Assignment[], Category = "homework", Score) * Course."Weight Homework" +
  AVERAGEIF_BY(Assignment[], Category = "quiz",     Score) * Course."Weight Quiz" +
  AVERAGEIF_BY(Assignment[], Category = "project",  Score) * Course."Weight Project" +
  AVERAGEIF_BY(Assignment[], Category = "exam",     Score) * Course."Weight Exam",
  1)
Letter grade
if FinalScore >= 93 then "A" elif FinalScore >= 90 then "A-" elif FinalScore >= 87 then "B+" elif FinalScore >= 83 then "B" elif FinalScore >= 70 then "C" else "F" end
Missing-submission flag
Assignment[*.Submitted = false].Title

3 · Mortgage / loan comparison

Rank a set of loan offers by monthly payment, total interest, and true cost after closing.

Per-offer summary
Loan[all].{
  name: Name,
  monthly: ROUND(PMT("Annual Rate" / 12, "Term Months", -Principal), 2),
  total_interest: ROUND(PMT("Annual Rate" / 12, "Term Months", -Principal) * "Term Months" - Principal, 2),
  true_cost: ROUND(PMT("Annual Rate" / 12, "Term Months", -Principal) * "Term Months" + "Closing Costs", 2)
}

4 · Expense policy auditor

Flag violations: meals over per-diem by city, missing receipts above $75, late submissions.

Per-diem over-limit
Item[*.Category = "meal" and Amount > VLOOKUP(City, Policy."Per Diem", 2, false)].Category
Missing receipt
Item[*.Amount > 75 and "Has Receipt" = false]
Late submission
NETWORKDAYS("Incurred Date", "Submitted Date") > 30

5 · Sales commission engine

Per-rep revenue, quota attainment, tier-based rate with accelerators, strategic-account kicker.

Quarter revenue
SUMIF_BY(
  Deal[],
  Stage = "closed-won" and "Close Date" >= "2026-01-01" and "Close Date" <= "2026-03-31",
  Amount
)
Tiered commission
if Attainment >= 1.2 then Revenue * 0.15
elif Attainment >= 1.0 then Revenue * 0.12
elif Attainment >= 0.8 then Revenue * 0.10
else                         Revenue * 0.08
end

6 · Medical lab panel interpretation

Label each lab result against the patient's age-and-sex reference range. Flag deviations from personal baseline.

Per-test status
Panel.Test[all].{
  name: Name,
  value: Value,
  status: if Value < "Reference Low"  then "low"
          elif Value > "Reference High" then "high"
          else "normal"
          end
}
Z-score vs personal history
Panel.Test[all].{
  name: Name,
  z_score: STANDARDIZE(
    Value,
    AVERAGE(History.Panel[all].Test[Name = Name].Value),
    STDEV_P(History.Panel[all].Test[Name = Name].Value))
}

7 · Rental property pro forma

10-year cash flow projection, NOI, cap rate, IRR.

NOI
(Property.Units * Property."Monthly Rent Per Unit" * 12 * (1 - Property."Vacancy Rate"))
  - Property."Annual Operating Expenses"
Monthly debt service
ROUND(
  PMT(
    Loan."Annual Rate" / 12,
    Loan."Term Years" * 12,
    -Loan.Amount
  ),
  2
)
IRR over the projection
IRR([-Equity] + Projection.Year[all]."Net Cash Flow" +[ReversionValue])

8 · Payroll / timesheet validator

Regular vs overtime hours, holiday multipliers, PTO-balance sanity check, lunch-break compliance.

Regular-hours pay
SUMIF_BY(
  Timesheet[],
  "Hours Worked" <= 8,
  "Hours Worked"
) * "Hourly Rate"
Overtime pay (1.5x)
SUMIF_BY(
  Timesheet[],
  "Hours Worked" > 8,
  "Hours Worked" - 8
) * "Hourly Rate" * 1.5
Lunch-break policy
Timesheet[*"Hours Worked" > 6 and "Lunch Taken" = false].Date

9 · Form conditional logic and auto-fill

Show / hide sections, compute dependent field values, cross-field validation.

Visibility
if Income > 100000 then "show high-earner section" else "hide" end
Monthly payment auto-fill
ROUND(
  "Loan Amount" * ("Annual Rate" / 12) *
  POWER(1 + "Annual Rate" / 12, "Term Months") /
  (POWER(1 + "Annual Rate" / 12, "Term Months") - 1),
  2)
Assets-vs-liabilities sanity
if SUM(Asset[all].Value) < SUM(Liability[all].Balance) then "red flag" else "ok" end

10 · Scientific measurement QA

Outlier detection, rolling statistics, drift alerts.

Outlier list (> 3 sigma)
Reading[*
    .ABS((Value - AVERAGE(Reading[all].Value)) / STDEV_P(Reading[all].Value)) > 3
].Timestamp
Drift vs historical
ABS(AVERAGE(Reading[all].Value) - History."Weekly Average") > 2 * History."Weekly Std Dev"

11 · Compound policy predicate — all / any / not composition

A business rule that fuses every row-level check into a single boolean expression. Works across collections, does pipe-like arithmetic comparison, and negates nested quantifiers. Every clause reads like a policy bullet.

"Invoice is ready to close" rule — multi-line for textarea authoring
all("Line Item"[], Taxable or "Line Total" < 5)
  and any(Payment[], Status = "captured")
  and not(any(Shipment[], Delivered = false))
  and (Customer."Credit Limit" - Total) > 0
Reads as four bullet points
1. Every line item is either taxable or trivially small (< $5).
2. Some payment has been captured.
3. No shipment is still outstanding.
4. The customer still has credit headroom.
Compiles to canonical jq
all(.lineItems[]; (.taxable) or (.lineTotal < 5))
  and any(.payments[]; .status == "captured")
  and ((any(.shipments[]; .delivered == false)) | not)
  and (.customer.creditLimit - .total) > 0
Why it composes cleanly: all / any are first-class — they evaluate a predicate over a collection and return a boolean, which boolean operators (and, or, not) combine as usual. No nested loops, no intermediate variables. The readable surface maps 1:1 to the english version; the compile stays jq-idiomatic so the sandbox runs it without surprises.

BXL Excel vs jq vs BXL — a VLOOKUP walkthrough

One end-to-end comparison. The business problem: "Given a travel expense, flag any line item that exceeds its city's per-diem rate." We need a LOOKUP from city to rate, then a comparison.

Data shape
{
  "Item": [
    { "Date": "2026-03-01", "City": "NYC", "Amount": 85 },
    { "Date": "2026-03-02", "City": "Austin", "Amount": 45 },
    { "Date": "2026-03-03", "City": "NYC", "Amount": 110 }
  ],
  "PerDiem": [
    { "City": "NYC",    "Limit": 90 },
    { "City": "Austin", "Limit": 60 },
    { "City": "SF",     "Limit": 100 }
  ]
}

Excel

=VLOOKUP + over-limit flag (spreadsheet form)
=IF(B2 > VLOOKUP(A2, PerDiem!A:B, 2, FALSE), "over", "ok")

Assumes the data lives across sheets — Items on the current sheet, PerDiem as a named table. Copy the formula down every row, one cell at a time. Works, but the filter lives outside the formula: you have to manually drag-copy, and the match mode (FALSE for exact) is Excel boilerplate.

Raw jq

Imperative — lookup + compare + label, per item
.Item[] |
  . as $item |
  (.Amount >
    (($item | .City) as $c |
     .. | objects | select(.City == $c) | .Limit | values)
  ) as $over |
  $item + { status: (if $over then "over" else "ok" end) }

Works but reads like a pointer dance. Recursive descent to find the matching entry, bind the city with as, assemble the output manually.

Raw jq (more disciplined)

Using INDEX-MATCH pattern via map + select
.Item | map(
  . as $row |
  ((.Amount) >
    (($PerDiem // root.PerDiem)[] | select(.City == $row.City) | .Limit)) as $over |
  $row + {status: (if $over then "over" else "ok" end)}
)

Still 5 lines, still needs as bindings to carry context across nested iterations. Reasonable jq, readable to a jq native.

BXL readable

One-line, schema-aware, reads as a policy check
IF (
  Item.Amount > VLOOKUP(
    Item.City,
    PerDiem[all].{City, Limit},
    2,
    false
  ),
  "over",
  "ok"
)
Alt: per-row projection via implicit [all]
Item.{
  date: Date,
  city: City,
  status: IF(Amount > VLOOKUP_BY(PerDiem[all], "City", City, "Limit"), "over", "ok")
}
Compiles to canonical jq — VLOOKUP_BY walks the PerDiem rows by City key, returns the matching Limit
[.Item[] | {
  date: .date,
  city: .city,
  status: IF(.amount > VLOOKUP_BY([.PerDiem[]]; "City"; .city; "Limit"); "over"; "ok")
}]

Side-by-side — the same rule in three forms

FormLinesReads asRequires
Excel1 (per row, drag-to-copy)a spreadsheet cell formulaA/B sheet references, manual dragging
Raw jq5a script with intermediate bindingsjq fluency, as $var chaining
BXL readable1–3a policy check in plain Englisha schema — which Boxel already has
Where BXL earns its keep. The Excel form is the one business users recognize, but it lives one row at a time in a grid. The jq form is expressive but asks the reader to follow variable bindings across 5 lines. The BXL form preserves the Excel mental model (VLOOKUP, IF, labels you see in the UI) while operating over the entire card's data in one expression that compiles to safe, sandboxed jq.
Where BXL is used in Boxel. Formula fields, Guide constraints, form visibility rules, workflow gates, notification predicates, annotation target paths, and inline document expressions. The same expression language in every authoring surface — one syntax, one evaluator, one sandbox.

jq Dot Paths & Navigation

Everything jq does still works. BXL sits on top of jq — canonical jq expressions are valid BXL. The readable surface above is the preferred authoring style when a schema is available; canonical jq is the compile target and the lingua franca for everything else (log output, machine-generated queries, jq-compatibility tests).

Basic Access

ExpressionResult
.
The entire current value (like "this row")
.name
Value of the name field
.patient.name
Nested field access
.orders[0]
First element of the orders array (zero-based in jq)
.orders[-1]
Last element
.orders[2:5]
Slice: elements at index 2, 3, 4

Safe Access & Fallbacks

ExpressionMeaning
.owner?.email
Optional access -- no error if owner is null
.owner?.email // "none"
Alternative operator -- fallback if null/missing
.items[]
Iterate: emit each element as a separate value
..
Recursive descent -- all values at every depth

jq Pipes & Transforms

The pipe | chains operations left-to-right. Each step feeds its output to the next.

map, select, sort

Transform every element
.lineItems | map(.qty * .unitPrice)
Filter by condition
.orders | map(select(.status == "paid"))
Sort and reverse
.orders | sort_by(.placedAt) | reverse
Deduplicate
.tags
| map(ascii_downcase)
| unique
| sort

group_by, flatten, add

Group and count
.orders
| group_by(.region)
| map({region:.[0].region, count:length})
Flatten nested arrays
.departments | map(.employees) | flatten
Sum an array
.scores | add

Operators

OperatorMeaningExample
|Pipe.items | map(.x)
,Both outputs.a, .b emits two values
+ - * / %Arithmetic.price * .qty
== != < <= > >=Comparison.age >= 18
and or notLogical.a and .b
//Alternative (fallback).x // 0
= |= += -=Update.count += 1

Core Constructing Values

Objects

ExpressionResult
{id, status, total}
Shorthand -- pulls fields from current value
{patient: .patientName, ward: .ward}
Renamed fields

Arrays

ExpressionResult
[.name, .ward, .diagnosis]
Array from specific fields
[.items[] | .name]
Collect iterated values into array

String Interpolation

"Patient: \(.firstName) \(.lastName)"
Embed computed values in strings

Core Bindings & Variables

Use as $name to capture intermediate values. Avoids repeating complex sub-expressions.

Bind and reuse
(.items | map(.qty * .price) | add) as $subtotal
| {
    subtotal: $subtotal,
    tax: ROUND($subtotal * 0.0825, 2),
    total: ROUND($subtotal * 1.0825, 2)
  }
Tip: When in doubt, bind it. $subtotal is clearer than repeating the pipeline three times, and safer than threading it through pipes that might break when edited later.

Core User-defined helpers (def)

Any BXL expression can open with its own named helpers. Syntax and scoping match jq's def. Because user helpers aren't from Excel or a preserved upstream helper family, they follow the lowercase naming convention — a def UPPERCASE would lie about paste-compatibility.

FormMeaning
def name: body;Zero-arg helper. Applied as a pipeline filter: .items | map(name).
def name(arg): body;One-arg helper. Call site: name(value).
def name(a; b; c): body;Multi-arg helper. Definition and call both use ;. BXL's comma-to-; rewrite is a convenience for known readable built-ins — paste ROUND("Unit Price", 2) from a spreadsheet or write isURL(Website, {require_protocol:true}), and BXL handles the translation to jq behind the scenes. User def calls don't get that rewrite; clamp(0, 100, x) won't resolve.
Single-arg helper next to a built-in
def band(n): if n >= 90 then "high" elif n >= 70 then "medium" else "low" end;
def triple(x): x * 3;

{
  band:    band(.score),
  tripled: triple(.score),
  total:   SUM([.items[].price])
}
Recursion
def fact: if . <= 1 then 1 else . * (. - 1 | fact) end;
5 | fact
Multi-arg (semicolons required on both sides)
def clamp(lo; hi; x): (x | if . < lo then lo elif . > hi then hi else . end);
clamp(0; 100; .score)
Helpers are scoped to the expression. There is no module system, and that's deliberate: a BXL expression is a self-contained, serializable piece of data, not a program that imports from other files. If you need the same helper in ten expressions, prepend the def to each one at build time, or materialize a single larger expression that holds them together.
Not available in computeVia. A card's computed fields run under the derive profile, which rejects def outright — expression(...) throws derive-def-banned when the field is defined. Use def in the playground and in expressions evaluated outside computeVia. See Computed Fields.

Core Control Flow

PatternSyntax
Conditionalif .x > 0 then "positive" elif .x == 0 then "zero" else "negative" end
Try/catchtry (.x / .y) catch "division error"
Reducereduce .items[] as $i (0; . + $i.amount)
Foreachforeach .items[] as $i (0; . + $i.amount)
Define functiondef double: . * 2; .values | map(double)
Label/breaklabel $out | foreach .[] as $x (0; .+$x; if .>100 then ., break $out else . end)

Formula Math & Rounding

FunctionDescriptionExample
ROUND(n, d)Round to d decimal placesROUND(3.14159, 2) → 3.14
ROUNDUP(n, d)Round away from zeroROUNDUP(3.141, 2) → 3.15
ROUNDDOWN(n, d)Round toward zeroROUNDDOWN(3.149, 2) → 3.14
ABS(n)Absolute valueABS(-42) → 42
CEILING(n, s)Round up to significance (alias: CEILING_MATH)CEILING(2.3, 1) → 3
FLOOR(n, s)Round down to significance (alias: FLOOR_MATH)FLOOR(2.7, 1) → 2
INT(n)Floor to integerINT(3.9) → 3
MOD(a, b)Modulo (always non-negative)MOD(10, 3) → 1
POWER(n, p)ExponentiationPOWER(2, 10) → 1024
SQRT(n)Square rootSQRT(144) → 12
PRODUCT(arr)Product of all numbersPRODUCT([2, 3, 4]) → 24
PIConstant 3.14159...PI → 3.14159...
SIGN(n)Returns -1, 0, or 1SIGN(-42) → -1
EVEN(n)Round up to nearest evenEVEN(3) → 4
ODD(n)Round up to nearest oddODD(4) → 5
GCD(arr)Greatest common divisorGCD([12, 8, 20]) → 4
LCM(arr)Least common multipleLCM([4, 6, 10]) → 60
FACT(n)FactorialFACT(5) → 120
FACTDOUBLE(n)Double factorialFACTDOUBLE(7) → 105
COMBIN(n, k)CombinationsCOMBIN(10, 3) → 120
COMBINA(n, k)Combinations with repetitionCOMBINA(4, 2) → 10
PERMUT(n, k)PermutationsPERMUT(10, 3) → 720
MROUND(n, m)Round to nearest multipleMROUND(7.5, 3) → 9
QUOTIENT(n, d)Integer divisionQUOTIENT(7, 2) → 3
DEGREES(rad)Radians to degreesDEGREES(PI) → 180
RADIANS(deg)Degrees to radiansRADIANS(180) → 3.14159...
RANDRandom number 0--1RAND → 0.7291...
RANDBETWEEN(lo, hi)Random integer in rangeRANDBETWEEN(1, 100)
SUMPRODUCT(arrays)Sum of element-wise productsSUMPRODUCT([[1,2],[3,4]]) → 11
SUMSQ(arr)Sum of squaresSUMSQ([3, 4]) → 25
MULTINOMIAL(arr)Multinomial coefficientMULTINOMIAL([2, 3, 4])
SERIESSUM(x, n, m, coeffs)Power series sumSERIESSUM(2, 1, 1, [1,2,3])
SQRTPI(n)Square root of n * PISQRTPI(2)
SUMX2MY2(x, y)Sum of x^2 - y^2 pairsSUMX2MY2([1,2], [3,4])
SUMX2PY2(x, y)Sum of x^2 + y^2 pairsSUMX2PY2([1,2], [3,4])
SUMXMY2(x, y)Sum of squared differencesSUMXMY2([1,2], [3,4])

Formula Statistics

FunctionDescriptionExample
SUM(arr)Sum of numbers (skips nulls)SUM([10, 20, 30]) → 60
AVERAGE(arr)Mean (skips nulls)AVERAGE([10, 20, 30]) → 20
COUNT(arr)Count of finite numbersCOUNT([1, "a", 3]) → 2
COUNTA(arr)Count of non-blank valuesCOUNTA([1, "a", null]) → 2
MAX(arr)MaximumMAX([3, 1, 4]) → 4
MIN(arr)MinimumMIN([3, 1, 4]) → 1
STDEV(arr)Sample standard deviation (alias: STDEV_S)STDEV([2, 4, 4, 4, 5, 5, 7, 9])
STDEV_P(arr)Population standard deviationSTDEV_P([2, 4, 4, 4, 5, 5, 7, 9])
MEDIAN(arr)Middle valueMEDIAN([1, 3, 5, 7]) → 4
VAR(arr)Sample variance (alias: VAR_S)VAR([2, 4, 4, 4, 5, 5, 7, 9])
VAR_P(arr)Population varianceVAR_P([2, 4, 4, 4, 5, 5, 7, 9])
LARGE(arr, k)Kth largestLARGE([3, 1, 4, 1, 5], 2) → 4
SMALL(arr, k)Kth smallestSMALL([3, 1, 4, 1, 5], 2) → 1
COUNTBLANK(arr)Count of empty/null valuesCOUNTBLANK([1, null, "", 3]) → 2
RANK_EQ(n, arr)Rank (descending)RANK_EQ(4, [5, 4, 3, 2]) → 2
RANK_AVG(n, arr)Rank with average for tiesRANK_AVG(4, [5, 4, 4, 2]) → 2.5
PERCENTILE_INC(arr, k)Percentile (inclusive)PERCENTILE_INC([1,2,3,4], 0.75) → 3.25
QUARTILE_INC(arr, q)Quartile (0--4)QUARTILE_INC([1,2,3,4], 1) → 1.75
CORREL(x, y)Correlation coefficientCORREL([1,2,3], [2,4,6]) → 1
SLOPE(y, x)Linear regression slopeSLOPE([2,4,6], [1,2,3]) → 2
INTERCEPT(y, x)Linear regression interceptINTERCEPT([2,4,6], [1,2,3]) → 0
FORECAST(x, y, knownX)Linear predictionFORECAST(4, [2,4,6], [1,2,3]) → 8
GEOMEAN(arr)Geometric meanGEOMEAN([2, 8]) → 4
HARMEAN(arr)Harmonic meanHARMEAN([2, 8]) → 3.2
TRIMMEAN(arr, pct)Mean excluding outliersTRIMMEAN([1,2,3,4,100], 0.4)
AVEDEV(arr)Average absolute deviationAVEDEV([2, 4, 8, 16])
DEVSQ(arr)Sum of squared deviationsDEVSQ([2, 4, 8, 16])
SKEW(arr)Distribution skewnessSKEW([1, 2, 3, 4, 100]) → positive
KURT(arr)Distribution kurtosisKURT([1, 2, 3, 4, 100]) → heavy-tailed
MAXIFS([vals, range, crit])Conditional maxMAXIFS([[5,3,8], [1,2,1], 1]) → 8
MINIFS([vals, range, crit])Conditional minMINIFS([[5,3,8], [1,2,1], 1]) → 5
PERCENTILE_EXC(arr, k)Percentile (exclusive)PERCENTILE_EXC([1,2,3,4,5], 0.4)
QUARTILE_EXC(arr, q)Quartile exclusive (1--3)QUARTILE_EXC([1,2,3,4,5], 1)
PERCENTRANK_INC(arr, x)Percentile rank (inclusive)PERCENTRANK_INC([1,2,3,4], 3) → 0.667
PERCENTRANK_EXC(arr, x)Percentile rank (exclusive)PERCENTRANK_EXC([1,2,3,4], 3) → 0.6
PEARSON(x, y)Pearson correlation (alias for CORREL)PEARSON([1,2,3], [2,4,6]) → 1
SUM and AVERAGE automatically skip nulls and non-numeric values, just like their spreadsheet counterparts.

Lazy Distribution & Test Functions

FormulaJS statistical distributions, inverse distributions, confidence intervals, and tests live in the lazy formula-statistical extension. Async runtimes load it only when an expression references one of these functions. Canonical BXL uses underscore names such as NORM_DIST(...); pasted Excel dotted names such as NORM.DIST(...) and T.TEST(...) are accepted in readable syntax and rewritten to the underscore form.

FamilyFunctions
Beta / binomialBETA_DIST BETA_INV BINOM_DIST BINOM_DIST_RANGE BINOM_INV NEGBINOM_DIST
Chi-square / F / T testsCHISQ_DIST CHISQ_DIST_RT CHISQ_INV CHISQ_INV_RT CHISQ_TEST F_DIST F_DIST_RT F_INV F_INV_RT F_TEST T_DIST T_DIST_2T T_DIST_RT T_INV T_INV_2T T_TEST
Normal / lognormal / exponential / Poisson / WeibullNORM_DIST NORM_INV NORM_S_DIST NORM_S_INV LOGNORM_DIST LOGNORM_INV EXPON_DIST POISSON_DIST WEIBULL_DIST
Gamma / hypergeometricGAMMA GAMMA_DIST GAMMA_INV GAMMALN GAMMALN_PRECISE HYPGEOM_DIST
Confidence / standardizationCONFIDENCE_NORM CONFIDENCE_T GAUSS PHI STANDARDIZE Z_TEST

Formula Conditional Aggregation

Two flavors: range-based (classic Excel) and _BY variants for arrays of objects.

Range-Based (Classic)

FunctionDescription
SUMIF(range, criteria)Sum where criteria matches
SUMIF(range, criteria, sumRange)Sum from a different range
COUNTIF(range, criteria)Count where criteria matches
AVERAGEIF(range, criteria)Average where criteria matches

Row-Object Variants (_BY)

FunctionExample
SUMIF_BY(rows, valueKey, criteriaKey, criteria)SUMIF_BY(., "amount", "region", "East")
SUMIFS_BY(rows, valueKey, criteriaObj)SUMIFS_BY(., "amount", &#123,region: "East", team: "A"&#125,)
COUNTIF_BY(rows, criteriaKey, criteria)COUNTIF_BY(., "status", "active")
COUNTIFS_BY(rows, criteriaObj)COUNTIFS_BY(., &#123,region: "East", team: "A"&#125,)
AVERAGEIF_BY(rows, valueKey, criteriaKey, criteria)AVERAGEIF_BY(., "score", "grade", "A")
AVERAGEIFS_BY(rows, valueKey, criteriaObj)AVERAGEIFS_BY(., "score", &#123,grade: "A"&#125,)
Criteria strings support prefixes: =, <>, >, >=, <, <=. Wildcards: * (any chars), ? (single char). Escape with ~.

Formula Lookups

FunctionDescription
VLOOKUP(val, table, colIdx)Vertical lookup -- search first column, return nth column
VLOOKUP(val, table, colIdx, rangeLookup)Set rangeLookup to false for exact match
VLOOKUP_BY(rows, lookupKey, val, resultKey)Row-object VLOOKUP
HLOOKUP(val, table, rowIdx)Horizontal lookup
LOOKUP(val, lookupArr, resultArr)Simple lookup with two arrays
LOOKUP_BY(rows, lookupKey, val, resultKey)Row-object LOOKUP
MATCH(val, arr, matchType)Position of match (1-based). matchType: 1, 0, or -1
INDEX(arr, row)Value at position
INDEX(arr, row, col)Value at row and column
CHOOSE(idx, options)Select from list by 1-based index
COL(rows, key)Extract column values from array of objects
VLOOKUP_BY example
VLOOKUP_BY(., "label", "ventilator", "amount")
INDEX + MATCH pattern
INDEX(.names, MATCH("target", .ids, 0))

INDEX — Excel's positional lookup takes the name

jq has an INDEX of its own: INDEX(stream; key_expr) builds an object keyed by an expression, and INDEX(key_expr) is the same over .[]. Excel's INDEX(array, row) claims the two-argument name here, and it wins — spreadsheet authors are this surface's audience and the formula library loads by default for cards. So the object-building INDEX is out of reach in both arities: the two-argument form resolves to Excel's positional lookup and fails with Cannot index array with string, and the one-argument form is jq's own index — index-of — in readable BXL, or a delegation to the shadowed two-argument form in canonical jq.

The linter says so rather than leaving that message to explain itself: a two-argument INDEX written with jq's semicolon reports jq-index-shadowed-by-excel at warning severity. One argument is not flagged, since index-of is a function in its own right, and jq has no three-argument INDEX to shadow. The substitutes are ordinary jq:

Substitutes
reduce Rows[] as $row ({}; .[$row.id] = $row)   -- key rows by a field
Rows | map({key: .id, value: .}) | from_entries -- the same, via pairs
INDEX(.names, 2)                                -- Excel: second name

Formula Text

FunctionDescriptionExample
TEXTJOIN(delim, skipEmpty, arr)Join with delimiterTEXTJOIN(", ", true, .names)
CONCAT(arr)Concatenate array values (alias: CONCATENATE)CONCAT(["a", "b"]) → "ab"
LEFT(text, n)First n charactersLEFT("Hello", 3) → "Hel"
RIGHT(text, n)Last n charactersRIGHT("Hello", 2) → "lo"
MID(text, start, n)Substring (1-based)MID("Hello", 2, 3) → "ell"
LEN(text)String lengthLEN("Hello") → 5
words(text)BXL — count of whitespace-separated non-empty tokens. No Excel equivalent.words("Ada Lovelace") → 2
UPPER(text)UppercaseUPPER("hi") → "HI"
LOWER(text)LowercaseLOWER("HI") → "hi"
PROPER(text)Title CasePROPER("hello world") → "Hello World"
TRIM(text)Trim + collapse spacesTRIM(" hi there ") → "hi there"
SUBSTITUTE(text, old, new)Replace all occurrencesSUBSTITUTE("aaa", "a", "b") → "bbb"
SUBSTITUTE(text, old, new, n)Replace nth occurrenceSUBSTITUTE("aaa", "a", "b", 2) → "aba"
REPLACE(text, pos, len, new)Replace by positionREPLACE("Hello", 1, 2, "Ya") → "Yallo"
REPT(text, n)RepeatREPT("ab", 3) → "ababab"
FIND(find, within)Case-sensitive position (1-based)FIND("lo", "Hello") → 4
SEARCH(find, within)Case-insensitive positionSEARCH("LO", "Hello") → 4
EXACT(a, b)Case-sensitive equalityEXACT("Hi", "hi") → false
CHAR(n)Code point to character (UNICHAR is the lazy FormulaJS spelling)CHAR(65) → "A"
CODE(text)First char to code point (alias: UNICODE)CODE("A") → 65
CLEAN(text)Remove control charsStrips 0x00-0x1F
VALUE(text)Parse string as numberVALUE("42") → 42
NUMBERVALUE(text, dec, grp)Locale-aware parsingNUMBERVALUE("1.234,56", ",", ".")

Formatting Helpers

FunctionDescriptionExample
TEXT(val, fmt)Format number as stringTEXT(.date, "yyyy-mm-dd")
DOLLAR(n, d)Format as currencyDOLLAR(1234.5, 2) → "$1,234.50"
FIXED(n, d, noCommas)Fixed decimal stringFIXED(1234.5, 2, false) → "1,234.50"

Formula Logic & Type Checking

Conditionals

FunctionDescriptionExample
IF(test, then, else)Excel-style conditional. The test is read with jq truthiness: only null and false are false, so IF(0, …) takes the true branch where Excel takes the false one.IF(.score >= 90, "A", "B")
IFERROR(val, fallback)Catch any errorIFERROR(.x / .y, 0)
IFNA(val, fallback)Catch only #N/AIFNA(VLOOKUP(...), "missing")
IFS(c1, v1, c2, v2, ...)Multiple conditions (2--4 pairs)IFS(.x > 90, "A", .x > 80, "B", true, "C")
SWITCH([expr, v1, r1, ...])Value-based dispatch (commas inside array)SWITCH([.status, "A", "Active", "I", "Inactive", "Unknown"])
when(p, q)BXL — implication shortcut. Equivalent to IF(p, q, TRUE). Useful for "if this applies, then this must hold" constraints.when(Payment = "Credit card", present("Bill To".Zip))
implies(p, q)BXL — alias for when. Preferred when the expression reads as logic.implies(Status = "shipped", "Tracking Number" != null)

Boolean Functions

FunctionDescription
TRUELiteral true
FALSELiteral false
NAProduce #N/A error (use as sentinel)
NOT(val)Boolean NOT
AND(arr)All truthy (skips nulls/strings)
OR(arr)Any truthy (skips nulls/strings)
XOR(arr)Odd count of truthy values

Presence & Nullability

FunctionDescriptionWhen to use
ISBLANK(val)Excel-strict — true only when val is null / undefined. Empty string is not blank.When you need Excel's exact semantics (paste-compatibility, audit rules that mirror a spreadsheet).
present(val)BXL — true when val is neither null nor "". Form-friendly opposite of ISBLANK.Form validation, "is this filled in?" checks. Usually what you want.
nonempty(arr)BXL — returns arr with null and "" entries removed. Chainable.Cleaning up split results or optional-field collections before counting or joining.
Presence helpers side-by-side
ISBLANK(Campaign)            -- true only when Campaign is null (Excel-strict)
present(Campaign)            -- false for both null and "" (form-friendly)
NOT ISBLANK(Campaign)        -- Excel-equivalent "filled in" check
nonempty(split(Donor, " "))  -- drop empty tokens before counting
words(Donor) >= 2            -- same intent, BXL shortcut

Type Checking & Error Detection

FunctionDescription
ISNUMBER(val)True if finite number
ISTEXT(val)True if string
ISERROR(val)True if any error
ISNA(val)True if #N/A error
ISERR(val)True if error but not #N/A
TYPE(val)Returns 1 (num), 2 (str), 4 (bool), 16 (error), 64 (array)
N(val)Convert to number (1/0 for bool)
T(val)Return string or ""
ERROR_TYPE(val)Error type code (1--8)
ISEVEN(val)True if even integer
ISODD(val)True if odd integer
ISLOGICAL(val)True if boolean
ISNONTEXT(val)True if not a string

validator.js Functions

BXL supports validator.js's boolean validator functions with the same function names and option-object shape authors already know. Write the call as if it were validator.isEmail(value, options), but omit the validator. namespace:

Call shape
isEmail(Email)
isURL(Website, {require_protocol:true})
isMobilePhone(Phone, "en-US", {strictMode:true})
isPostalCode(Zip, "US")
isCreditCard("Card Number")
isStrongPassword(Password, {minLength:12})
isUUID(ID, 4)

Validator.js functions use readable comma arguments like Excel and other BXL helpers, then compile to jq's semicolon form internally. The compiler lookup is case-insensitive, but the formatter canonicalizes back to validator.js casing, so ISEMAIL(Email) solidifies to isEmail(Email) and compiles to isEmail(.email).

Non-string inputs and invalid validator.js option values return false instead of throwing. isStrongPassword(value, {returnScore:true}) preserves validator.js behavior and returns the score number. isAfter(value) and isBefore(value) use validator.js's default comparison date, which is "now"; they are therefore treated as volatile in restricted BXL profiles. Pass {comparisonDate:"2026-01-01"} when you need stable validation.

Use jq test(re) for bespoke regex rules; use validator.js functions when the rule is one of its familiar predicates. Sanitizers and converters such as trim, escape, normalizeEmail, toInt, and toDate are not part of the validation extension.

Functionvalidator.js shapeTypical use
containscontains(value, seed[, options])String containment with validator.js options. value | contains(seed) remains jq.
equalsequals(value, comparison)Exact string comparison.
matchesmatches(value, pattern[, modifiers])Regex predicate with validator.js shape. One-arg matches(query) remains BXL's predicate-profile full-text hook.
isEmailisEmail(value[, options])Email address.
isURLisURL(value[, options])URL; commonly isURL(Website, {require_protocol:true}).
isFQDNisFQDN(value[, options])Domain / host name.
isIPisIP(value[, version])IPv4 or IPv6 address.
isIPRangeisIPRange(value[, version])CIDR IP range.
isMobilePhoneisMobilePhone(value[, locale[, options]])Locale-aware mobile phone number.
isPostalCodeisPostalCode(value, locale)Locale-aware postal / ZIP code.
isMailtoURIisMailtoURI(value[, options])mailto: URI.
isMagnetURIisMagnetURI(value)Magnet URI.
isDataURIisDataURI(value)Data URI.
isJWTisJWT(value)JWT token shape.
isUUIDisUUID(value[, version])UUID.
isULIDisULID(value)ULID.
isMongoIdisMongoId(value)MongoDB ObjectId.
isAbaRoutingisAbaRouting(value)US ABA routing number.
isBICisBIC(value)SWIFT/BIC code.
isIBANisIBAN(value[, options])IBAN.
isCreditCardisCreditCard(value[, options])Credit card number.
isCurrencyisCurrency(value[, options])Currency amount string.
isEthereumAddressisEthereumAddress(value)Ethereum address.
isBtcAddressisBtcAddress(value)Bitcoin address.
isEANisEAN(value)EAN code.
isIMEIisIMEI(value[, options])IMEI.
isISBNisISBN(value[, version])ISBN-10 or ISBN-13.
isISINisISIN(value)Securities identifier.
isISRCisISRC(value)Recording code.
isISSNisISSN(value[, options])Serial publication code.
isISO6346isISO6346(value)Shipping container ID.
isFreightContainerIDisFreightContainerID(value)Alias-style container ID validator.
isISO6391isISO6391(value)ISO 639-1 language code.
isISO15924isISO15924(value)ISO 15924 script code.
isISO31661Alpha2isISO31661Alpha2(value[, options])ISO 3166-1 alpha-2 country code.
isISO31661Alpha3isISO31661Alpha3(value[, options])ISO 3166-1 alpha-3 country code.
isISO31661NumericisISO31661Numeric(value)ISO 3166-1 numeric country code.
isISO4217isISO4217(value)ISO 4217 currency code.
isIdentityCardisIdentityCard(value, locale)Locale-aware national identity card number; use "any" to check all supported locales.
isLicensePlateisLicensePlate(value, locale)Locale-aware license plate.
isPassportNumberisPassportNumber(value, countryCode)Passport number.
isTaxIDisTaxID(value[, locale])Tax ID.
isVATisVAT(value, countryCode)VAT number.
isAlphaisAlpha(value[, locale[, options]])Letters only.
isAlphanumericisAlphanumeric(value[, locale[, options]])Letters and numbers only.
isAsciiisAscii(value)ASCII-only string.
isBase32isBase32(value[, options])Base32 string.
isBase58isBase58(value)Base58 string.
isBase64isBase64(value[, options])Base64 string.
isBooleanisBoolean(value[, options])Boolean string.
isByteLengthisByteLength(value, options)UTF-8 byte length range. Pass the options: upstream validator.js reads the minimum with no fallback, so the one-argument form compares against undefined and is false for every string. Its sibling isLength has the fallback.
isDecimalisDecimal(value[, options])Decimal number string.
isDivisibleByisDivisibleBy(value, number)Numeric string divisible by number.
isEmptyisEmpty(value[, options])Empty string.
isFloatisFloat(value[, options])Float string with optional range.
isFullWidthisFullWidth(value)Contains full-width characters.
isHalfWidthisHalfWidth(value)Contains half-width characters.
isHashisHash(value, algorithm)Hash by algorithm.
isHexadecimalisHexadecimal(value)Hexadecimal string.
isHexColorisHexColor(value[, options])CSS hex color.
isHSLisHSL(value)CSS HSL color.
isInisIn(value, values)Membership in allowed values.
isIntisInt(value[, options])Integer string with optional range.
isJSONisJSON(value[, options])JSON string.
isLatLongisLatLong(value[, options])Latitude/longitude string.
isLengthisLength(value[, options])Character length range.
isLocaleisLocale(value)Locale string.
isLowercaseisLowercase(value)Lowercase string.
isLuhnNumberisLuhnNumber(value)Luhn checksum.
isMACAddressisMACAddress(value[, options])MAC address.
isMD5isMD5(value)MD5 hash.
isMimeTypeisMimeType(value)MIME type.
isMultibyteisMultibyte(value)Contains multibyte characters.
isNumericisNumeric(value[, options])Numeric string.
isOctalisOctal(value)Octal string.
isPortisPort(value)Port number string.
isRgbColorisRgbColor(value[, options])CSS RGB/RGBA color.
isSemVerisSemVer(value)Semantic version.
isSlugisSlug(value)Slug string.
isStrongPasswordisStrongPassword(value[, options])Password strength boolean or score.
isSurrogatePairisSurrogatePair(value)Contains surrogate-pair characters.
isTimeisTime(value[, options])Time string.
isUppercaseisUppercase(value)Uppercase string.
isVariableWidthisVariableWidth(value)Mixture of full/half-width characters.
isWhitelistedisWhitelisted(value, chars)Only characters from chars.
isDateisDate(value[, options])Date string.
isAfterisAfter(value[, options])Date after comparison date; volatile without comparisonDate.
isBeforeisBefore(value[, options])Date before comparison date; volatile without comparisonDate.
isRFC3339isRFC3339(value)RFC 3339 timestamp.
isISO8601isISO8601(value[, options])ISO 8601 date/time.

Formula Date

Formula Helpers

FunctionDescription
DATE(year, month, day)Build Excel date serial number
DAY(date)Day of month (1--31)
MONTH(date)Month (1--12)
YEAR(date)Year
YEARFRAC(start, end, basis)Fraction of year between dates (basis 0--4)
DAYS(end, start)Days between two date serials
TODAYCurrent date as Excel serial number
HOUR(serial)Hour component (0--23)
MINUTE(serial)Minute component (0--59)
SECOND(serial)Second component (0--59)
WEEKDAY(serial, type)Day of week (type 1: Sun=1..Sat=7)
ISOWEEKNUM(serial)ISO week number
EDATE(start, months)Date offset by N months
EOMONTH(start, months)End of month, offset by N months
DATEDIF(start, end, unit)Difference in "Y", "M", "D", "MD", "YM", "YD"
DATEVALUE(text)Parse date string to serial number
DAYS360(start, end, method)Days on 360-day year (US/European)
WEEKNUM(serial, type)Week number (type 1: Sun start, 2: Mon start)
NETWORKDAYS(start, end, holidays)Business days between dates
WORKDAY(start, days, holidays)Date offset by N business days
TIME(hour, min, sec)Time as fraction of day
TIMEVALUE(text)Parse time string ("14:30") to fraction

jq Date Functions

FunctionDescription
nowCurrent Unix timestamp
strptime(fmt)Parse date string
strftime(fmt)Format timestamp
mktimeBroken-down time to Unix timestamp
gmtimeUnix timestamp to UTC time array
todateTimestamp to ISO-8601 string
fromdateISO-8601 string to timestamp
Date difference in days
((.endDate | strptime("%Y-%m-%d") | mktime)
 - (.startDate | strptime("%Y-%m-%d") | mktime)) / 86400

Formula Financial

Financial functions are a lazy FormulaJS extension. Async runtimes (runNativeJqAsync, prepareNativeJqAsync, prepareBoxelRuntimeAsync) auto-load formula-financial when an expression references one of these functions. Sync evaluateBxl / runNativeJq does not load them unless the lazy library has been explicitly registered — in a card's computeVia they are already available, see Computed Fields.

Time Value of Money

FunctionDescription
PMT(rate, nper, pv, fv, type)Payment per period
IPMT(rate, per, nper, pv, fv, type)Interest portion of payment
PPMT(rate, per, nper, pv, fv, type)Principal portion of payment
FV(rate, nper, pmt, pv, type)Future value
PV(rate, nper, pmt, fv, type)Present value
NPER(rate, pmt, pv, fv, type)Number of periods
RATE(nper, pmt, pv, fv, type, guess)Interest rate per period
FVSCHEDULE(principal, schedule)FV with variable rates

Investment Analysis

FunctionDescription
NPV(rate, values)Net present value
NPV_BY(rate, rows, valueKey)NPV from row objects
IRR(values, guess)Internal rate of return
IRR_BY(rows, valueKey, guess)IRR from row objects
MIRR(values, finRate, reinRate)Modified IRR
XNPV(rate, values, dates)NPV for irregular cash flows
XNPV_BY(rate, rows, valKey, dateKey)XNPV from row objects
XIRR(values, dates, guess)IRR for irregular cash flows
XIRR_BY(rows, valKey, dateKey, guess)XIRR from row objects

Other Financial

FunctionDescription
CUMIPMT(rate, nper, pv, start, end, type)Cumulative interest between periods
CUMPRINC(rate, nper, pv, start, end, type)Cumulative principal between periods
EFFECT(nominal, npery)Effective annual rate
NOMINAL(effective, npery)Nominal annual rate
SLN(cost, salvage, life)Straight-line depreciation
SYD(cost, salvage, life, per)Sum-of-years depreciation
ACCRINT(issue, first, settle, rate, par, freq, basis)Accrued interest over the quasi-coupon periods first anchors
DB(cost, salvage, life, period, month)Declining balance depreciation
DDB(cost, salvage, life, period, factor)Double declining balance
ISPMT(rate, per, nper, pv)Interest for straight-line payments
PDURATION(rate, pv, fv)Periods to reach target value
RRI(nper, pv, fv)Required rate of return
DOLLARDE(frac, denom)Fractional dollar to decimal
DOLLARFR(dec, denom)Decimal dollar to fractional
DISC(settle, maturity, pr, redemption, basis)Discount rate of a security
PRICEDISC(settle, maturity, disc, redemption, basis)Price of discounted security
COUPDAYS(settle, maturity, freq, basis)Days in coupon period
TBILLEQ(settle, maturity, discount)T-bill bond-equivalent yield
TBILLPRICE(settle, maturity, discount)T-bill price per $100
TBILLYIELD(settle, maturity, price)T-bill yield
Monthly car payment
PMT(0.065 / 12, 60, 25000, 0, 0)
Project NPV
NPV(0.08, [-40000, 8000, 9200, 10000, 12000])

Formula Engineering

Most engineering helpers below are lazy FormulaJS extensions: base conversion, bitwise operations, complex numbers, ERF / ERFC, CONVERT, and UNICHAR. ROMAN and ARABIC remain eager formula helpers. Bessel functions are lazy too, but live in the smaller formula-bessel extension rather than the shared engineering/financial bundle.

Base Conversion

FunctionDescription
BIN2DEC / DEC2BINBinary ↔ Decimal
BIN2HEX / HEX2BINBinary ↔ Hex
BIN2OCT / OCT2BINBinary ↔ Octal
DEC2HEX / HEX2DECDecimal ↔ Hex
DEC2OCT / OCT2DECDecimal ↔ Octal
OCT2HEX / HEX2OCTOctal ↔ Hex
BASE(n, radix, minLen)Arbitrary base conversion
DECIMAL(text, radix)Parse from arbitrary base

Bitwise Operations

FunctionDescription
BITAND(a, b)Bitwise AND
BITOR(a, b)Bitwise OR
BITXOR(a, b)Bitwise XOR
BITLSHIFT(n, shift)Left shift
BITRSHIFT(n, shift)Right shift

Roman numeral conversion

FunctionDescriptionExample
ROMAN(n)Arabic integer → Roman numeral string. Errors on negative input; floors non-integers.ROMAN(42) → "XLII"
ARABIC(text)Roman numeral string → Arabic integer. Errors on malformed input (validates via strict regex).ARABIC("MCMXCIV") → 1994
Both helpers match Microsoft Excel exactly and round-trip: ARABIC(ROMAN(N)) = N for any non-negative integer N.

Complex Numbers

FunctionDescription
COMPLEX(real, imag, suffix)Construct complex number string
IMABS(val)Modulus
IMREAL(val)Real part
IMAGINARY(val)Imaginary part
IMCONJUGATE(val)Complex conjugate
IMSUB(a, b)Complex subtraction
IMSUM(values)Complex sum
DELTA(a, b)1 if equal, 0 otherwise
GESTEP(n, step)1 if ≥ step, 0 otherwise
IMCOS(z)Complex cosine
IMCOSH(z)Complex hyperbolic cosine
IMCOT(z)Complex cotangent
IMCSC(z)Complex cosecant
IMCSCH(z)Complex hyperbolic cosecant
IMSIN(z)Complex sine
IMSINH(z)Complex hyperbolic sine
IMTAN(z)Complex tangent
IMSEC(z)Complex secant
IMSECH(z)Complex hyperbolic secant
IMEXP(z)Complex exponential
IMLN(z)Complex natural log
IMLOG10(z)Complex log base 10
IMLOG2(z)Complex log base 2
IMDIV(a, b)Complex division
IMPRODUCT(values)Complex product
IMPOWER(z, n)Complex power
IMSQRT(z)Complex square root
IMARGUMENT(z)Angle (argument) of complex number
ERF(lower, upper)Error function (Gauss)
ERFC(x)Complementary error function
BESSELI(x, n)Modified Bessel function In (lazy async)
BESSELJ(x, n)Bessel function Jn (lazy async)
BESSELK(x, n)Modified Bessel function Kn (lazy async)
BESSELY(x, n)Bessel function Yn (lazy async)
CONVERT(n, from, to)Unit conversion (120+ units, SI prefixes)
UNICHAR(n)Code point to character (lazy FormulaJS spelling; CHAR is eager)
CONVERT examples
CONVERT(1, "mi", "km")       // 1.609344
CONVERT(100, "C", "F")       // 212
CONVERT(1, "gal", "L")      // 3.785...
CONVERT(1, "kg", "lbm")    // 2.204...
CONVERT(1024, "byte", "kibyte") // 1 (binary prefix)

Boxel Computed Fields

In Boxel, BXL expressions live inside computeVia on a field definition. Import the compute factory and syntax tags from @cardstack/bxl, then assign the returned function to computeVia. The field type acts as the output contract. expression() validates the source against the derive profile when it is constructed, so volatile calls, request/mutation context, authored jq try / catch, jq def / error, and runtime metadata helpers are rejected before the field runs.

Import and call-site modes
import { expression, fx, jq } from '@cardstack/bxl';

@field subtotal = contains(NumberField, {
  computeVia: expression(fx`SUM("Line Item".Amount)`),
});

@field slug = contains(StringField, {
  computeVia: expression(jq`.title | ascii_downcase | gsub("[^a-z0-9]+"; "-")`),
});

@field tax = contains(NumberField, {
  computeVia: expression('ROUND(Subtotal * TaxRate / 100, 2)'),
});
No tag and fx both mean readable BXL: labels, PascalCase fallback, and Excel comma-call syntax are enabled. jq means plain jq: no readable rewrite, no label fallback, and jq syntax stays exact.
The lazy families need no registration in a card. Financial (PMT, NPV, IRR), the statistical distributions, Bessel, engineering, and the validator.js helpers are all resolvable inside a computeVia — write them exactly as documented. The exceptions are the clock-reading helpers the derive profile refuses as volatile: TODAY, NOW, RAND, RANDBETWEEN, isAfter and isBefore.
Subclass materialization with as
@field statusPanel = contains(RegularStatusField, {
  computeVia: expression(
    jq`
      if .severity == "Critical" then { label: "ICU CARE", tone: "red" }
      elif .severity == "High" then { label: "ICU Watch", tone: "orange" }
      else { label: "ICU Monitoring", tone: "blue" }
      end
    `,
    { as: IcuStatusField },
  ),
});
as is optional for scalar values and normal declared field classes. Add it when a structured result should be materialized as a more specific FieldDef or subclass, such as contains(RegularStatusField, { computeVia: expression(..., { as: IcuStatusField }) }), so Boxel uses the subclass instance for serialization and rendering.

Field Type → Expression Return Type

Field DeclarationExpression Must Return
contains(NumberField)A number
contains(StringField)A string
contains(BooleanField)A boolean
contains(SomeFieldDef)An object matching the FieldDef shape
containsMany(NumberField)An array of numbers
containsMany(SomeFieldDef)An array of objects

Chaining Computed Fields

One field references another
@field subtotal = contains(NumberField, {
  computeVia: expression('.lineItems | map(.qty * .unitPrice) | add'),
});

@field total = contains(NumberField, {
  computeVia: expression('ROUND(.subtotal * 1.0825, 2)'),
});
Computed fields can reference other computed fields on the same card. Each field is one step -- explicit, testable, and easy to trace.

Reading Across Relationships

ExpressionWhat it does
.attendingClinician.name
Read a field from a linked card
.consultTeam | map(.name)
Map over a linksToMany relationship
.patient.firstName + " " + .patient.lastName
Concatenate across a link

Boxel jq Builtins Index

Complete index of core jq functions available in BXL.

Array / Object

FunctionDescription
lengthLength of string/array/object
keys / keys_unsortedSorted / unsorted keys
has(key)Test if key/index exists
contains(v)Deep containment check
in(obj)Test if input is key in obj
inside(v)Test if input is contained in v
map(f)Apply f to each element
map_values(f)Apply f to all values
select(f)Keep elements where f is truthy
del(f)Delete paths
addSum/fold array
sort / sort_by(f)Sort array
reverseReverse array
unique / unique_by(f)Deduplicate
group_by(f)Group by key
min_by(f) / max_by(f)Extremes by key
flatten / flatten(n)Flatten to depth
join(sep)Join array to string
to_entriesObject to [{key, value}]
from_entries[{key, value}] to object
with_entries(f)Transform entries
transposeMatrix transpose
indices(v)All indices of v
index(v) / rindex(v)First / last index
range(n) / range(a;b)Number range
walk(f)Apply f to all nodes bottom-up
recurse(f)Recursive descent
paths / leaf_pathsAll / leaf paths
getpath(p) / setpath(p; v)Path access
pick(pathexps)Pick paths from input
ROWS(arr) / COLUMNS(arr)Row/column count

String

FunctionDescription
ascii_downcase / ascii_upcaseCase conversion
ltrimstr(s) / rtrimstr(s)Remove prefix / suffix
trim / ltrim / rtrimTrim whitespace
startswith(s) / endswith(s)Test prefix / suffix
split(s)Split on string
test(re) / match(re)Regex test / match
capture(re)Named capture groups
scan(re)All regex matches
sub(re; s) / gsub(re; s)Regex substitution
tostring / tonumberType conversion
tojson / fromjsonJSON encode/decode
explode / implodeString ↔ codepoints

Type Selectors

FunctionDescription
typeReturn type name as string
arrays / objects / strings / numbers / booleans / nullsSelect by type
values / scalarsNon-null / scalar values
iterablesArrays or objects
isnan / isinfinite / isnormal / isfiniteNumber predicates
nan / infiniteIEEE constants

Iteration & Flow

FunctionDescription
first / first(g)First element / output
last / last(g)Last element / output
nth(n; g)Nth output
limit(n; g)First n outputs
skip(n; g)Skip first n outputs
isempty(g)True if generator is empty
any / any(f) / any(g; f)Existential test
all / all(f) / all(g; f)Universal test
while(cond; update)Emit while condition holds
until(cond; next)Apply until condition holds
repeat(f)Repeat forever
combinationsCartesian product
emptyProduce no output

Math (jq native)

CategoryFunctions
Trigsin cos tan asin acos atan atan2(y)
Hyperbolicsinh cosh tanh asinh acosh atanh
Exp/Logexp exp2 exp10 log log2 log10 pow(y) sqrt cbrt
Roundingfloor ceil round trunc fabs
Otherhypot(y) fmax(y) fmin(y)

Boxel String Formats

Used as @fmt "..." or format("fmt") for string interpolation.

FormatDescriptionExample
@textConvert to string (default)42 | @text → "42"
@jsonJSON-encode{a:1} | @json → '{"a":1}'
@htmlHTML-escape"<b>" | @html → "&lt;b&gt;"
@uriPercent-encode"a b" | @uri → "a%20b"
@uridPercent-decode"a%20b" | @urid → "a b"
@csvCSV row["a","b"] | @csv → "\"a\",\"b\""
@tsvTSV row["a","b"] | @tsv → "a\tb"
@shShell-escape"it's" | @sh → "'it'\\''s'"
@base64Base64 encode"hello" | @base64
@base64dBase64 decode"aGVsbG8=" | @base64d

How to use formatters

Three patterns, in order of how often you'll reach for them.

1 · Pipe form — "transform this value"

Most common. Put | @fmt at the end of any expression.
"Bill To".Name | @html                         -- HTML-escape for safe render
Invoice | @json                                  -- serialize the whole card
"Upload Token" | @base64                         -- encode a secret
[Customer.Name, Customer.Email] | @csv        -- one CSV row

2 · Literal-with-interpolation form — "inject values into a string safely"

Following a format with a literal string runs every \(expr) inside it through that formatter. Use this whenever you're building output that lands in HTML, a URL, a shell command, JSON, CSV, or anywhere else with escaping rules.

Each interpolation is auto-escaped by the format in front.
@html "Hi <b>\(Customer.Name)</b>, order \(Order Number)"
  -- Customer.Name and Order Number are HTML-escaped before insertion

@uri "/search?q=\(Query)&page=\(Page)"
  -- Query ("cats & dogs") becomes "cats%20%26%20dogs"

@sh "echo \(Message)"
  -- Shell-escapes the message so `'` / `$` / `\\` stay literal

@csv "\(Invoice Number),\(Total),\(Currency)"
  -- Produces a valid CSV row with commas quoted when they appear in fields
When to reach for this. Anywhere an interpolation value could break the surrounding format — user-typed fields in HTML, search terms in URLs, filenames in shell commands, free text in CSV. The format-prefix contract guarantees every \(…) inside the string is pre-escaped for that sink. Without the prefix you'd hand-call @html / @uri / @sh on each interpolation separately and hope you remembered all of them.

3 · Round-trip encode → decode

Encoders come paired. Use the d variant to reverse.
"Opaque Token" | @base64 | @base64d    == "Opaque Token"
"Query String" | @uri    | @urid       == "Query String"

Common recipes

NeedBXL
Safe-render a user string into HTML@html "Hello \(Name)"
Build a URL query string@uri "/api?q=\(Query)"
Serialize a card for logging / debugging. | @json
Emit one CSV row per invoiceInvoice[all] | map([.Number, .Total] | @csv)
Encode a binary payloadAttachment.Bytes | @base64
Build a safe shell command@sh "mv \(Source) \(Dest)"

Boxel Error Codes

BXL uses Excel-compatible error codes. Catch them with IFERROR, IFNA, or try/catch.

ErrorCodeMeaning
#NULL!1Null reference
#DIV/0!2Division by zero
#VALUE!3Wrong value type
#REF!4Invalid reference
#NAME?5Unknown function name
#NUM!6Numeric error (overflow, domain)
#N/A7Value not available
#GETTING_DATA8Data still loading
Handling errors
IFERROR(.revenue / .headcount, 0)

try (.x | tonumber) catch "not a number"

IF(ISERROR(.lookup), "fallback", .lookup)

Boxel Excel Function Coverage

BXL implements 300+ functions from the Excel/Google Sheets function set, plus 16 BXL-only extensions (the _BY row-object variants). This section maps coverage against the FormulaJS library.

Available via jq (use lowercase)

These Excel functions are not implemented as uppercase helpers because jq already provides them natively. Use the lowercase jq version.

Exceljq equivalentCategory
SIN COS TANsin cos tanTrig
ASIN ACOS ATAN ATAN2asin acos atan atan2Trig
SINH COSH TANHsinh cosh tanhHyperbolic
ASINH ACOSH ATANHasinh acosh atanhHyperbolic
EXP LOG LOG10exp log log10Exp/Log
LNlog (jq's log is natural log)Exp/Log
TRUNCtruncRounding
SORTsort / sort_by(f)Array
UNIQUEunique / unique_by(f)Array
TRANSPOSEtransposeArray
NOWnow (Unix timestamp)Date
Range-based multi-criteria functions (SUMIFS, COUNTIFS, AVERAGEIFS) are not implemented as uppercase helpers because BXL's _BY variants (SUMIFS_BY, COUNTIFS_BY, AVERAGEIFS_BY) are more natural for JSON data. Use those instead.

Lazy Extensions and Unsupported Families

Some FormulaJS families are implemented but intentionally lazy because they pull heavier optional dependencies or are rarely needed. Others are explicitly not supported in BXL because they assume a spreadsheet grid, criteria ranges, or array-returning analysis shapes that do not fit JSON computed fields.

CategoryFunctionsStatus
Lazy statistical distributions and testsBETA.DIST BINOM.DIST CHISQ.DIST F.DIST GAMMA.DIST NORM.DIST POISSON.DIST T.DIST WEIBULL.DIST and their .INV, .RT, .TEST variantsLoaded only by async runtimes when an expression calls one of these functions. Canonical BXL uses underscore names such as NORM_DIST(...); pasted dotted names are accepted in readable syntax.
Lazy financial formulasPMT NPV IRR XIRR FV PV RATE COUPDAYS TBILLPRICE and the rest of the Financial sectionLoaded by async runtimes as formula-financial. Shares the formula-extras bundle with lazy engineering.
Lazy engineering formulasBIN2DEC BITAND COMPLEX IM* ERF ERFC CONVERT UNICHAR and related helpersLoaded by async runtimes as formula-engineering. ROMAN and ARABIC remain eager.
Lazy Bessel functionsBESSELI BESSELJ BESSELK BESSELYLoaded by async runtimes as formula-bessel when an expression calls one of these specialized engineering functions.
DatabaseDAVERAGE DCOUNT DCOUNTA DGET DMAX DMIN DPRODUCT DSTDEV DSTDEVP DSUM DVAR DVARPUnsupported in BXL. Excel database functions assume a flat cell range with criteria ranges. BXL uses map/select/_BY variants instead -- more powerful on JSON.
Grid referenceCOLUMN ROW SUBTOTAL AGGREGATEUnsupported in BXL. These require a cell grid model. No equivalent concept exists in JSON expressions. Note: ROWS(arr) and COLUMNS(arr) are supported array-shape helpers; singular ROW / COLUMN are not.
MatrixMMULT MUNITUnsupported in BXL. Matrix multiplication and identity belong in jq array pipelines or dedicated math libraries.
RegressionLINEST LOGEST GROWTH TRENDUnsupported in BXL. These return regression arrays / projections whose shapes don't map cleanly to single computed fields.

Coverage Summary

StatusCountNotes
Implemented300+All targeted Excel-compatible formula functions plus validator.js functions; large helper families load lazily in async runtimes
Lazy extension libraries4formula-statistical, formula-bessel, formula-engineering, formula-financial
BXL-only extensions16_BY row-object variants, COL, ERROR_TYPE
Available via jq23Trig, exp/log, sort, unique, transpose, now (use lowercase)
Won't add~30Database functions, grid reference functions, matrix helpers, regression arrays