Run one model with different inputs
Keep editing while inputs need correction
Calculator Apps keep your entered values in the input draft when a field is missing or invalid. Affected fields are marked in red, and input labels, help, and page navigation remain available.
Rules already known from the input declaration, such as a minimum or maximum, are checked when you leave the field. A red outline appears immediately, without waiting for a calculation. Checks that depend on the active calculation are reported when you update the results.
If the model defines a usable default for an affected scalar field, the calculation can use that default. Existing authored cards use their own defaults; new cards use the model's new-card defaults. Results lists the assumed value explicitly; the value you entered stays in the draft for correction. If a repeatable card has an invalid field without a usable default, that card is left out of the calculation. Other valid cards still contribute. For nested cards, only the affected inner card is left out. Correct the field and run again to include the card.
An input outside a repeatable card can also use its model default. If no usable default is available, the run stops and shows the error in Results, while your inputs remain visible and unchanged. The error includes the field's configured label and input page when available, together with its full input path.
These rules also apply when a calculation reports an input validation error with a field path during the run; model authors do not need an extra required setting for each such check. An error in model code that does not identify an input field still appears as a calculation error.
Save a Calculator App report as PDF
Use the print icon in the input toolbar to open Print / PDF. The expanded list shows the app's main Input and Results pages. Select individual pages, or select a group to include all its pages. A partially selected group shows an intermediate checkbox state.
Show PDF opens the report in a new tab. Download PDF saves the same report to a file. Every tab within a selected page is included in order. The report presents input values as text, uses a white paper layout, repeats table headers across page breaks, and splits wide tables into readable column groups. Run the app first to include results; the PDF uses the available results and current input values.
Change input values in model code
Declare a precondition once, then pass an inline run configuration to each run. The model itself does not need to change.
import { cashflow, category, currencies, defineModel, entity, inflow, input, periods, run, schedule } from "deccf";
const growth = input.rate(0.02);
const company = entity.asset();
const revenue = cashflow({
dynamic:true,
owner: company,
direction: inflow,
category: category("business.sales"),
schedule: schedule.monthly({ from: "2026-01", to: "2027-12" }),
amount: (ctx) => 10_000 * (1 + ctx.get(growth)) ** (ctx.time.index / 12),
});
const model = defineModel({
name: "first-model",
currency: currencies.USD,
timeline: periods.monthly({ from: "2026-01", count: 24 }),
preconditions: { growth },
entities: { company },
flows: { revenue },
});
const slow = run(model, { deterministic: { inputs: { growth: 0.01 } } });
const fast = run(model, { deterministic: { inputs: { growth: 0.04 } } });
return model;Keys in deterministic.inputs match names in the model's preconditions map. Values can be JavaScript numbers, strings (including text read from a file), Money values, or date strings for input.date() preconditions. A wrapped value may use { value, source }. To replace a curve, use { series: { points: [{ date, value }], interpolation } }.
You can also use deterministic.parameters with keys such as "inputs.growth"; that form only accepts scalar values. Curves use deterministic.inputs. The compatibility option overrides takes a Map keyed by input references.
A precondition can only be overridden once in a run. Do not set the same input through overrides, parameters, and inputs at the same time. Unknown names, invalid types, out-of-domain values, and invalid shapes raise a ModelError.
runScenarios() accepts scenarios with a name and overrides: Map, keyed by the model's input references. For several object-based input sets, call run() separately; each call returns a new result and leaves the model unchanged. For the interactive batch workflow in the Calculator, see Create scenarios in the Calculator.