Appearance
Variables
A variable is a named value of the whole installation: a tax rate, an approval limit, the day a season opens. Filters, rules and defaults use it instead of a typed value, so when the value changes you change it in one place and every list, rule and form that uses it follows.
Administration › Data › Variables lists them. Administrators, and people whose role has the Manage variables permission, add and change them; everyone signed in can use them.
Making a variable
New variable asks for:
Name : What people see, such as Approval limit.
Key : How filters and rules refer to it, written in braces: {approval_limit}. Suggested from the name; lowercase letters, digits and _.
Type : Number, Text, Date or Yes or no. The value must be of this type: a number is written in the installation's number format, a date as a day.
Group : Variables with the same group are listed together under its name, such as Tax rates for a standard, a reduced and a food rate. Groups already in use are offered while you type. Variables without a group come last.
Value and Description : The value can be left empty for now. The description says what the value is for.
The key and the type stay as they are once the variable is made, because filters and rules depend on them; to change either, add a new variable. A variable that a filter, rule or default still uses cannot be deleted: the message names the entities that use it.
Where variables are used
- Filters — in the filter builder, the { } button beside a value compares with a variable instead: Amount is greater than Approval limit. Saved views, quick filters and tables of sub-records work the same way. Variables fit fields of their kind: a number variable for number fields, a date variable for date fields, and so on.
- Rules — a field's Required only when…, a form section's Show only when…, an information block's rule.
- Formulas —
price * (1 + {vat_rate})in a formula field. When the value changes, every record's formula is worked out again. - Defaults — a field's Default for new records can be The value of a variable of a fitting type (text for text, email, link and phone fields; number for whole and decimal numbers; date; yes or no).
Rules and filters always use the value the variable has now: lowering the approval limit makes more records match at once.
In the API, a filter value written as "{approval_limit}" is the variable's value; GET /api/v1/variables lists them.