Variables
A Variable is a named parameter that powers a piece of advice. Variables can be passed in as input or produced by the Rules Engine as the result of a formula, rule, or calculation.
Every API response includes a variables[] array. A single Variable looks like this:
{
"dataType": "Freetext",
"format": null,
"id": "qT7UxR1ii",
"isConstant": false,
"isToggleable": false,
"isSystem": false,
"name": "Account_Type",
"nameAlt": "Account Type",
"type": "VARIABLE",
"value": "Roth IRA",
"valueDefault": null
}Filtering Variables in the response
The default response often includes more Variables than a given client needs. The filter parameter trims the variables[] array. Combine values with commas:
?filter=variables,variables:!system,variables:!constant
The example above drops Variables with a null value, System Variables, and Constant Variables. Each value can also be used on its own:
| Value | Effect |
|---|---|
filter=variables | Drops Variables with a null value |
filter=variables:!system | Drops System Variables |
filter=variables:!constant | Drops Constant Variables |
Not the same as Sparse FieldsetsVariable filters trim entries from the
variables[]array. Sparse Fieldsets trim properties off each entry. The two are independent and can be combined.
Variable properties
id
idA unique identifier for the Variable.
dataType
dataTypeThe data type stored in the Variable. Possible values:
ArrayBooleanDateFreetextNumberPercent(alias forNumberwith a percentformat)Radio
name
nameThe canonical name of the Variable. Names always match /(^[a-zA-Z0-9][a-zA-Z0-9_?]*$)/ — alphanumerics, underscores, and question marks only.
nameAlt
nameAltA friendlier label for the Variable. Often unused.
value
valueThe current value. A null here means the underlying question has not been answered yet.
valueDefault
valueDefaultA Taffrail-defined default for common scenarios — for example, 67 for Retirement_Age.
format
formatA format string the renderer uses to display the value. Most commonly used for Number, Percent, and Date. The API also returns valueFormatted with the format already applied.
{
"format": "0[.]0",
"value": 1.23,
"valueFormatted": "1.2"
}For all Variable types except Array, format is a string. For Array types, format is itself an array, with each entry matching the index of the corresponding value entry:
{
"type": "Array",
"value": [1, 2, 3],
"format": [null, null, "0.0%"],
"valueFormatted": [1, 2, "3.0%"]
}See Formats for the full format string reference.
isToggleable
isToggleableOnly Boolean Variables can be toggleable. When true, the Backlink should render as a switch- or toggle-style control rather than a chip.
isConstant
isConstanttrue for Variables whose values are fixed reference data — IRS limits, regulatory thresholds, and similar — rather than user inputs. Use this to filter constants out of the UI.
isSystem
isSystemtrue for Variables used internally by the Rules Engine. System Variables are not meant for display. Pass filter=variables:!system to drop them from the response.
Updated 17 days ago
