What a variable has
A variable is defined in a domain and takes on a value when a calculation runs. As defined, a variable has:- A key — an identifier, unique within the domain. You reference a variable by its key when you provide or solve for it (see Input formats), and the API returns it on each variable.
- A title and description — human- and agent-readable labels.
- A type and display format — how the value is interpreted and shown (see below).
- A default value — an optional value and unit used when none is provided.
- A value — the number or table it currently holds, with its unit where applicable; the unit travels with the value (see Units and precision).
- Provenance — where that value came from: user-stated, calculated, carried forward, or a default. See Provenance.
Types and display formats
A variable holds one of TrueMath’s value types — a scalar number, a unit number, or a table — and specifies how it should be displayed:number— a plain number, shown with thousands separators and a chosen decimal format. A monetary amount is a number whose unit is a currency (for exampleUSD).percent— a rate shown as a percentage.no_separator— a number shown without thousands separators (for example, a year).table— a collection of values with named rows and columns.bar_chart/pie_chart— a table presented as a chart.
To list the variables in a published domain, use
GET /v1/domains/:id/variables.
