Skip to content
Smart Templates Manual Website Manual for your AI

Variables

In short

A variable is a value that you define yourself or have calculated: a payment term as a date, a salutation depending on the country, a gross amount, a color that depends on the amount. It gets a name and a type. You click together its content step by step, with condition branches if you like. Then you insert the variable into texts, conditions and color fields like a field. In addition there are variables of a rule, which calculate individually for each row of their rule, and system variables such as today’s date and the page number.

Three kinds of variables

KindWhere it isValue
Custom variablein the area “Data” under “Custom variables”, as “@Name”one value for the whole document, calculated once on the printed record
Variable of a rulein the window “Edit rule”, “Variables” tab; afterward as a field under the rulea separate value for each row of the rule
System variablein the area “Data” under “System variables”filled in by the system when the document is created, such as date and page number

You edit custom variables and variables of a rule in the same window. This page describes it for custom variables. What is different for a variable of a rule is described under Rules: What is different for a variable of the rule. You do not create system variables; they are already there (see System variables).

Excerpt of the area “Data”. The category “Custom variables” is expanded; in its header on the right is the symbol @. Below it a search box and six entries with a colored badge on the left and a small pencil on the right: “@Zahlungsziel” (violet, “Date”), “@Netto”, “@USt” and “@Brutto” (green, “123”) as well as “@Zahlungsstatus” and “@Akzentfarbe” (blue, “Abc”). Below that the likewise expanded category “System variables” with a search box and six entries: “Current page” and “Total pages” (green, “123”), “Current date” (violet, “Date”), “Current time” (blue, “Abc”), “Date & time” (violet, “Date”) and “User” (blue, “Abc”).
Custom variables and system variables in the area “Data”.
  1. 1The category “Custom variables”. The arrow expands and collapses it.
  2. 2The button “+ New” opens the window “New variable”.
  3. 3The badge names the type: Date, 123 (number or currency), Abc (text or color), Yes/No.
  4. 4The pencil opens “Edit variable” without inserting the variable. A click on the name inserts it.
  5. 5The system variables are directly below and are already there; you do not create them.

Creating a custom variable

  1. In the area “Data”, click “+ New” to the right of “Custom variables” (mouse pointer: “Create a new custom variable”). The window “New variable” opens. Name and type are empty; below them there is only a note that you should choose the type first.
  2. Under “Name”, enter a name, for example “Zahlungsziel”.
  3. Under “Type”, choose what the variable contains, for example “Date”. The window now shows “What should it contain?”, and for number and currency also “What should it look like?”.
  4. Under “What should it contain?”, define the content, row by row. At the bottom the window shows what comes out with the sample record: “Result with the current sample data: …”.
  5. Click “Save”. The window closes. The variable appears under “Custom variables” as “@Zahlungsziel” and can be inserted right away.

A custom variable needs no data source. Even in a new template without a primary source, the category “Custom variables” with the button “+ New” is ready.

Other ways into the window

  • In the window “Edit text”: The list “Variables — drag or click to insert” has the same category “Custom variables” with “+ New” and ✎ (see The “Edit text” window: Inserting fields).
  • In a field picker: Wherever the window “Choose field” shows the category “Custom variables”, for example in a condition, “+ New” and ✎ are there as well. After “Save” the field picker is visible again with the new variable in it; choose it with a click. The pickers of the e-invoice are an exception: there the custom variables are only available for selection, and you create a new one with “Create variable …” (see E-invoice: ZUGFeRD and XRechnung: Choosing a value).
  • From the color picker: “ƒ Variable …” and then “New color variable …” opens the window with the type “Color” (see Using a variable as a color).
  • In a rule: The button “Variable” in the “Variables” tab creates a variable of the rule (see Rules: “Variables” tab: Values per row).
  • Editing: The ✎ at the end of an entry (mouse pointer: “Edit variable”) opens the window “Edit variable” without inserting the variable anywhere.

Tip

Save the variable you are currently working on before you create another one. Then create the next one from the area “Data”. In a field picker that you opened from the open variable window (for the value or the condition of a condition branch), use neither “+ New” nor the ✎. As far as we know, the first window otherwise reacts neither to “Save” nor to “Cancel”.

Using the window

At the top, “Name” and “Type” are side by side. Below them follow, for number and currency, “What should it look like?”, then “What should it contain?” with the condition branches, and at the end the preview line. Next to the labels there is an ⓘ: when you point at it, an explanation appears; a click opens it in a window.

  • Footer: On the left “Delete” (only for an existing variable), on the right “Cancel” and “Save”. The footer stays in place when you scroll the content.
  • Size: If you drag an edge, the window becomes larger or smaller.
  • Above other windows: The window lies over an open window, for example over “Edit rule” or a field picker. The window behind it stays as it is.
  • Closing without saving: “Cancel”, the ✕ at the top right (mouse pointer: “Close”), the Esc key and a click next to the window all do the same: all changes are discarded. For an existing variable, the state from when it was opened returns, including the name.
  • Esc with several windows: Esc usually closes the topmost window, for example a color picker, a field picker or the large text window above the variable window (see Keyboard shortcuts: Esc in detail). If you opened the window from a color picker or via “+ New” in a field picker, that picker is still underneath. As far as we know, Esc closes it first; then close the variable window with its buttons.

Caution

A click next to the window discards your entries without asking. Always apply them with “Save”.

Name and type

SettingWhat it doesDefault
“Name” (with ⓘ) You insert the variable under this name. Letters are allowed, including umlauts, ß and accented letters, plus digits, spaces and the underscore. The field removes other characters such as hyphen, period, parentheses or @ immediately while you type, without a message. “Save” removes spaces at the beginning and at the end. Upper and lower case count: “Netto” and “netto” are two different names. Each name may occur only once in the template. empty (gray: “e.g. Payment term”)
“Type” (with ⓘ) What the variable contains: “Text”, “Number”, “Currency”, “Yes/No”, “Date” or “Color”. The type is required. As long as none is chosen, “— please choose —” is shown in the selection with the colored outline, and instead of the entries there is only the note “First choose the type. It decides what you can enter: for number and currency there are sum, count and average; for date »later/earlier« with days, months or years; for yes/no exactly two states.” As soon as a type is chosen, “— please choose —” disappears from the list. none; via “New color variable …” “Color”

The type decides which steps there are, which fields the field picker offers, whether calculations are done and how the value is printed. You can change it at any time. The window then rebuilds itself, and the content is kept. If it cannot be split into steps in the new type, the window shows it as a formula (see The formula view). A variable from an older template that does not have a type yet gets a type when it is opened, which the window derives from its content. Check it before saving.

The following sections say for each type how the variable calculates and what appears in the PDF. Which steps and which fields there are for each type is collected under What should it contain?.

Type Text

The parts are joined together, not calculated: “2 + 3” stays “2 + 3”, and a postal code such as “01069” keeps its leading zero. From the second row on, “and then” appears on the left. The value is plain text, including line breaks. You set font, size and color where you insert the variable. In the PDF the text appears literally: line breaks become line changes, and whatever is in a field appears exactly as it is there.

Type Number

The variable is really calculated, with “plus”, “minus”, “times” and “divided by” (see Operators). A field that is missing counts as 0. Above it is “What should it look like?” with three fields.

  • In the PDF: The number appears in the number style of the template or of the variable. Which decimal places and which thousands separators apply is described under What should it look like?.
  • Cannot be calculated: If the calculation cannot be carried out, for example because of a comma in “1,19”, the PDF prints the calculation text itself, and the feedback on the document names the place.
  • Dividing by zero: The place stays empty, and the feedback on the document says so.

Type Currency

The variable calculates like a number; the fixed step is called “Fixed amount” here. “What should it look like?” has four fields, including the “Currency symbol”. In the PDF the amount appears with the symbol after it, separated by a space at which the line never breaks. Without a number of decimal places of its own, the “Decimal places (currency)” of the template apply (see Numbers, currency and dates: Currency & numbers).

Type Yes/No

The variable has exactly one step; there are no further rows. The fixed value is a selection with “Yes” and “No”. In the PDF, “Ja” or “Nein” appears in the language of the template (see Numbers, currency and dates: Template language). An empty value stays empty; it does not become “No”. If the variable takes over a yes/no field from Dynamics, for example “Bezahlt”, what counts is whether the field is set to yes or no, not its label: with the label “Unbezahlt”, “Nein” appears, and in conditions the variable is No. A variable of a rule, by contrast, prints the label, that is, “Unbezahlt”; in conditions it is also No (see Rules: What is different for a variable of the rule).

Type Date

The first row is the date, each further row is a period that is added or subtracted. How this works is described under Calculating with dates. In the PDF the result appears in the date format of the template (see Numbers, currency and dates: Date & time).

Type Color

The variable supplies a color code such as #d13438. It has exactly one step: a fixed color or a value from a field or another variable. Instead of a text field there are a color swatch and a field for the color code (see A fixed color). With condition branches the color depends on a condition, as the image shows; how they are built is described under Condition branches.

The window “New variable” with the name “Betragsfarbe” and the type “Color”. Below it two boxes. The upper one with the blue heading “IF” and a red ✕ contains a condition box with “AND | OR” and a card “Rechnung › Summen › Gesamtbetrag”, “greater than”, value “1000”, plus the buttons “Condition” and “Subgroup”. Below it “THEN” with a row “= | Fixed color”, a red square color swatch and a field with the color code “#d13438”, below that on the right “ƒx as formula”. The second box “ELSE” contains “= | Fixed color”, a green color swatch and “#2e7d32”. Under the boxes the button “Condition branch” and the preview line “Result with the current sample data: #d13438”. At the very bottom “Cancel” and “Save”.
A color variable with a condition branch: red if the total amount is above 1000, otherwise green.
  1. 1The type “Color” supplies a color code such as #d13438.
  2. 2Instead of a text field there are a color swatch and a field for the color code. The swatch opens the color picker.
  3. 3ELSE: the color that applies if no branch matches.
  4. 4The preview shows the color code that results for the sample record.
  • In the PDF: Only a valid color code is drawn: #rgb, #rrggbb or #rrggbbaa, each with the hash sign. Anything else, such as “rot”, “red”, a typo or an empty value, results in no color and draws nothing; a colored passage of text then keeps the color of its surroundings. What is missing at each place is described under Border, background and colors: Invalid color. If the color comes from a field and the hash sign is missing there, it is not added (see Border, background and colors: Which notations apply).
  • One value for the document: A custom color variable has one color in the whole document, including in every table row. In the color picker, only custom variables appear under “ƒ Variable …”, no variables of a rule.

What should it look like?

For a custom variable of the type Number or Currency, you define under “What should it look like?” (with ⓘ) how it is printed. The default in each case is what the template settings say under “Numbers & date” (“From template”; for the decimal places of a number “Automatic (up to 4)”). You set it there once for all, also with if-then (see Numbers, currency and dates: Currency & numbers). Here you only set a fixed exception value for this one variable; if-then is deliberately not available here. For Number there are three fields side by side, for Currency four in two rows.

The window “New variable”. At the top, side by side, the field “Name” with “Brutto” and the selection “Type” with “Currency”. Below it the label “What should it look like?” with an info symbol and four fields in two rows: top left “Decimal places” with “From template (2)”, top right “Number style” with “From template (1.234,56)”, bottom left “Thousands separator” with “From template”, bottom right “Currency symbol” as an input field with the gray placeholder “From template (€)”. Below that “What should it contain?” and the gray box “CONTENT”. First row: equals sign, selection “Sum of”, field “Gesamt”, red ✕. Second row: selection “times”, selection “Fixed amount”, number field with “1.19”, a button with a frame symbol, an info symbol and a red ✕. Below it the button “Calculation step” with a calculator symbol and on the right “ƒx as formula”. Under the box the button “Condition branch” and the preview line “Result with the current sample data: 4.444,65 €”. At the very bottom “Cancel” and “Save”.
A currency variable: the sum of the item amounts times 1.19, with the settings for its appearance above.
  1. 1To how many places it is rounded (0 to 6). Default: the places of the template.
  2. 2Comma or period, depending on the country.
  3. 3Whether large numbers are separated in groups of three.
  4. 4Empty means: the symbol from the template settings. In print it appears after or before the amount, depending on the number style.
  5. 5From the second row on, the operator is on the left. Multiplication and division before addition and subtraction also applies when the rows are one below the other.
  6. 6The result with the sample record, already with the settings above (places, number style, symbol).
SettingWhat it doesDefault
“Decimal places” To how many places it is rounded, commercially: from 5 upward. You can choose 0 to 6; where other ranges apply elsewhere is described under Numbers, currency and dates: How many decimal places are possible where. For a number, “Automatic (up to 4)” shows as many places as needed, at most four. With a fixed number, thousands separation is added; with “Automatic (up to 4)” it is not; the “Thousands separator” changes that (see below). The details are described under Numbers, currency and dates: How the document prints numbers and amounts. Currency: “From template (…)” with the number of places of the template; Number: “Automatic (up to 4)”
“Number style” Comma or period, depending on the country: “1.234,56”, “1,234.56”, “1 234,56”, “1'234.56” or “1234.56”. “From template (…)” with an example of the style that applies
“Thousands separator” Whether large numbers are separated in groups of three: “From template”, “Always separate” or “Never separate”. The two fixed choices take precedence over the rule for the decimal places: with them you also separate a number without a fixed number of places, or you leave one with a fixed number of places unseparated. “From template”
“Currency symbol” (currency only) Appears after the amount (“1.234,56 €”) or before it (“$1,234.56”, “CHF 1'234.56”; see Numbers, currency and dates: Where the currency symbol appears), depending on the number style. Empty means: the symbol from the template settings, including their if-then. The symbol may come from a field; to do so, enter the field name in double curly braces, for example {{waehrungssymbol}}. It is always read on the printed record, also in a table row. A field that exists only in the row therefore stays visible as a placeholder. The field removes spaces at the edges. empty (gray: “From template (€)” with the symbol that applies)
  • Where it applies: The settings apply everywhere the variable is printed. If a placeholder of the variable itself carries a number of places, for example from an imported template, it replaces only the decimal places from here; number style and thousands separator remain those of the variable. In the window “Edit text”, such a number of places cannot be entered (see Numbers, currency and dates: Decimal places and symbol for a single field).
  • Round first, then sum: If the variable summarizes a list (“Sum of”, “Average of”), each individual value is rounded to the decimal places of the variable before adding, otherwise to the “Decimal places (currency)” of the template, also for quantities and weights (see Rules: Round first, then sum).
  • Effective immediately: Every choice applies right away, and the preview line recalculates. “Cancel” restores the old state.

For Yes/No, Text, Date and Color this section does not exist. For a variable of a rule, a note appears in its place (see Rules: What the value looks like).

What should it contain?

Under “What should it contain?” (with ⓘ) you build the value row by row. Each row is a step and has four parts: on the left, what happens with the step, in the first row an =; then the kind of value; then the value itself; on the right a ✕ as soon as there is more than one row. As long as there are no condition branches, all of this is in the box “CONTENT”.

The kind of value

KindWhat it suppliesFor the types
“Variable”a field, another custom variable or, depending on the type, a system variable, chosen with “Choose field …”all
“Fixed text”, “Fixed number”, “Fixed amount”, “Fixed value”, “Fixed date”, “Fixed color”a value that you enter (see Fixed values)one of them per type
“Sum of”, “Average of”, “Smallest value of”, “Largest value of”a summary over a list, for example the sum of all item amountsNumber, Currency
“Count of”how many entries a list hasText, Number, Currency
“First value of”the value from the first row of a list, even if it is emptyText, Number, Currency, Yes/No, Date
“Earliest of”, “Latest of”the earliest or latest date of a listDate, first row
  • A new row always starts with the fixed kind of the type. If you change the kind, the value of this row is cleared.
  • For Date, from the second row on there are only “Fixed number” and “Variable”, because a count goes there (see Calculating with dates). For Color, only “Fixed color” and “Variable” are available.
  • If, for “Variable”, you choose in the field picker a field of a list with a summary on the right of the field, such as “Sum”, the kind switches by itself, for example to “Sum of”. If a summary is already set as the kind, it stays, and only the field is taken over.

The button “Choose field …”

For “Variable” and for the summaries, the value is a button, initially labeled in gray with “Choose field …”. It opens the window “Choose field” with the data tree. How the window is built and operated, including the summary on the right of the field of a list, is described under Data tree and field picker: The “Choose field” window.

The type of the variable determines what the picker offers, including whether it shows the “System variables” in addition to the “Custom variables”:

TypeWhat the field picker shows
Textall fields, all custom variables and all six system variables, including the page numbers
Number, Currencynumber and money fields and custom variables of the type Number or Currency; no system variables
Yes/NoYes/No fields and Yes/No variables; no system variables
Date, first rowdate fields, date variables and, of the system variables, “Current date” and “Date & time”
Date, from the second row onnumber and money fields and custom variables of the type Number or Currency
Coloreverything, without restriction, including the page numbers

The type likewise restricts the calculated fields of a rule and their attributes: for Number and Currency, for example, all calculations except minimum and maximum of a date field are available, and of the variables of the rule only those of the type Number or Currency.

After the choice, the button shows the name of the field, for example “Betrag”, and a custom variable as “@Name”. You see the complete path when you point at the button with the mouse. A click opens the picker again.

Operators

From the second row on, the left side shows how the step is joined to the one before it:

  • Number and Currency: a selection with “plus” (default), “minus”, “times” and “divided by”. Multiplication and division come before addition and subtraction: “times” and “divided by” are calculated first, even if the rows are one below the other. = 100, plus 50, times 2 therefore gives 200, not 300.
  • Date: “later” (default) adds the period, “earlier” subtracts it.
  • Text: the fixed label “and then”; the parts are joined together.
  • Yes/No and Color: no second row.

Example for a gross amount (type Currency): in the first row “Sum of” with the field “Betrag” of the items, in the second “times” and “Fixed amount” 1.19. There are no parentheses in the rows. If you need, for example, (100 + 50) × 2, create a variable of its own for the parenthesis and keep calculating with it, or write the calculation in the formula view.

Fixed values

KindEntryGood to know
“Fixed text” (Text) a field with the gray note “Text”, next to it ⛶ (mouse pointer: “Open a larger text window — line breaks allowed”) Every entry applies immediately. If the text contains line breaks, the field is for viewing only: a line break appears as ⏎, and a click opens the large text window.
“Fixed number” (Number), “Fixed amount” (Currency) a field with the gray note “e.g. 1.19”, next to it ⛶ (mouse pointer: “Open a larger window — line breaks are removed”) and an ⓘ Write decimal numbers with a period. A comma is not converted: “1,19” cannot be calculated (see Type Number), and the next time it is opened the window shows the value as a formula. In a comparison in a condition, by contrast, the designer reads a comma as a period (see Numbers, currency and dates: Reading numbers: comma and period).
“Fixed value” (Yes/No) a selection with “Yes” and “No” Exactly two states. See the note under the table.
“Fixed date” (Date, first row only) your browser’s date picker The chosen day is stored. The picker shows it in your browser’s language, the PDF in the date format of the template.
“Fixed color” (Color) a color swatch and a field with the gray note “#rrggbb” See A fixed color.

Good to know

For a new fixed Yes/No value, the selection shows “No”. As far as we know, however, the window does not take over “No” until you have changed the selection once; otherwise the value stays empty and prints nothing. Watch the preview line: if it shows “(empty)”, choose “Yes” once and then “No” again.

A fixed color

  • With the mouse: The color swatch opens the color picker “Choose a color” (see Border, background and colors: Color field and color picker). In this picker the entry “New color variable …” is missing, and the variable you are currently editing is not in its list.
  • Typed: In the field next to it, type the color code. While you type, it is only marked, as with every color field (see Border, background and colors: Invalid color); the mouse pointer here says “That is not a hexadecimal code — something like #d13438 is expected. …” When you leave the field, the window completes what is unambiguous: “d13438” becomes “#d13438”, with the note “Color corrected to »#d13438« — a hexadecimal code starts with »#«.”
  • Valid are #rgb, #rrggbb and #rrggbbaa. The variable does not accept the four-character short form (#rgba), unlike the color field on an object (see Border, background and colors: Which notations apply).
  • On saving, every fixed value is checked strictly, in the “ELSE” and in every condition branch (see Saving). A color name such as “rot” is not guessed but rejected. A value from a field or another variable is not checked, because it only shows itself with the real data.

The buttons under the rows

ButtonWhat it does
“Calculation step” (Number, Currency; calculator symbol), “Period” (Date; calendar with arrow), “Text part” (Text; “T” with a text cursor) Sits in the middle under the rows and appends an empty row: for the calculation step with “plus”, for the period with “later” and “Days”. “Save” leaves out empty rows. For Yes/No and Color the button does not exist.
✕ on the right in the row (mouse pointer: “Remove this step”) Removes the step together with its operator, without asking. Appears only if there is more than one row.
“ƒx as formula” on the right under the rows (mouse pointer: “Edit as formula (for parentheses and special cases)”) Switches this one value to the formula view. The base value and each condition branch have their own “ƒx as formula”. Only the view changes; nothing about the value changes.

The formula view

In the formula view, the value appears as a single line in typewriter type. You write it by hand, for example with parentheses. Every entry applies immediately, and the preview line recalculates. If the field is empty, it shows an example for each type:

  • Number and Currency: e.g. ({{amount}} + 5) * 1.19
  • Date: e.g. {{dateadd(date, 14, day)}}
  • Yes/No: e.g. true or {{paid}}
  • Color: e.g. #d13438 or {{color}}
  • Text: e.g. Invoice {{number}}

These rules apply to the formula:

  • References: Every reference to a field or a variable is in double curly braces {{ }}, for example {{betrag}}. A custom variable is called {{@Name}} there.
  • Calculating: For Number and Currency, calculation happens when, after insertion, only numbers, the characters + - * / (plus, minus, times, divided by), parentheses and whitespace remain. If anything else remains, nothing is calculated; the text is assembled instead. A custom variable of the type Text or Date inserts its text: with “10-20” or “2026-03-20” the calculation stays text, and the document reports it. A Yes/No variable counts as 1 or 0. There are no further functions or characters such as round, % or ^.
  • Decimal numbers with a period: {{netto}} * 1.19. A comma as in “1,19” turns the formula into text (see Fixed values).
  • Missing field and dividing by zero: A field that is missing counts as 0. Dividing by zero leaves the place empty (see Type Number).

The formula view also appears by itself when a value cannot be split into rows: for parentheses and other notations that the rows do not know, for a negative number at the beginning, for a comma in a number and for several parts in a Yes/No or color variable.

Under the field, “← guided” leads back to the rows (mouse pointer: “Back to the guided view”). If the value cannot be split, the button is gray, and the mouse pointer says “Cannot be split into steps (e.g. parentheses) — going back clears the expression.”

Caution

If “← guided” is gray, a click on it deletes the whole formula, without asking. If you did that by accident, “Cancel” closes the window without any change.

It is better to change a multi-line text via ⛶ than in the formula view: there, line breaks appear as spaces, and as far as we know they are lost as soon as you change anything in the formula view.

The large text window

The ⛶ next to a fixed value opens a large text window with a text area that you can drag larger downward, and the buttons “Cancel” and “Apply”. “Apply” writes the text into the step; “Cancel”, Esc and a click next to the window discard it.

  • For fixed text: heading “Text of the variable »Name«”, below it the note “Text and line breaks only. Set font, size and color where you use the variable — not here.” Line breaks are kept.
  • For a fixed number and a fixed amount: heading “Fixed value of the variable »Name«”, below it the note “A fixed value of this calculation — for example a rate like 1.19 or a longer expression. Line breaks are removed when you apply: the value goes into the calculation unchanged, and a line break would sit in the middle of it.”

If the variable does not have a name yet, it is missing from the heading.

Calculating with dates

For a variable of the type Date, the first row is the date. Every further row is a period that you add or subtract. The periods are applied one after the other from top to bottom. This turns “invoice date plus payment term” into a single variable.

  • First row: “Variable” takes a date field, another date variable or the system variable “Current date” or “Date & time”. “Fixed date” opens a date picker. “First value of”, “Earliest of” and “Latest of” take a date from a list.
  • Every further row: on the left “later” or “earlier”, then the count, and on the right the unit “Days” (default), “Months” or “Years”. For “Fixed number”, the count is a number field with the gray note “e.g. 30”; for “Variable”, it is a number field of the data or a custom variable of the type Number or Currency.
  • “Save” leaves out a period row without a count. If the first row has no date, nothing at all results, even if periods are entered.

Three rules apply to the calculation. The mouse pointers on count and unit also state the first two.

  • Calculation is in whole units; decimal places are dropped: 30.9 days are 30 days.
  • For months and years, the result stays in the target month. If the day does not exist there, the last day of that month applies: January 31 plus one month is February 28.
  • If, when the document is created, the count does not supply a number, for example because the chosen field is empty in the record or contains a Yes/No value, a text or a list instead of a number, no date results: the place stays empty, a condition using it does not apply, and the feedback on the document says so. As soon as sample data is loaded, the designer points this out as well. The only thing it does not detect is a field that has no value in the sample record; only the feedback on the document reports that.
  1. Create a variable, name “Zahlungsziel”, type “Date”.
  2. In the first row, choose the kind “Variable”, click “Choose field …” and choose the invoice date.
  3. Click “Period”. A second row appears with “later”, “Fixed number” and “Days”.
  4. Enter 30 as the count. The preview line shows the invoice date of the sample record plus 30 days.
  5. Click “Save”.
The window “New variable”. At the top left the title, at the top right a ✕. Below it, side by side, the field “Name” with the word “Zahlungsziel” and the selection “Type” with the entry “Date”, each with an info symbol. Below that the label “What should it contain?” and a gray box with the heading “CONTENT”. The first row in the box reads: an equals sign, the selection “Variable”, a field with the word “Rechnungsdatum”, a red ✕. The second row: the selection “later”, the selection “Fixed number”, a number field with “30”, the selection “Days”, a red ✕. Under the rows in the middle the button “Period” with a calendar symbol, on the right the text “ƒx as formula”. Under the box the button “Condition branch” and below it, with a blue stripe on the left, the preview line “Result with the current sample data: 27.07.2026”. At the very bottom the bar with “Cancel” and “Save”.
A date variable: invoice date plus 30 days gives the payment term.
  1. 1The name under which you insert the variable. Letters, digits, spaces and the underscore are allowed.
  2. 2The type is required and decides which steps there are.
  3. 3The first row is the date, here the invoice date from the data.
  4. 4Every further row is a period: later or earlier, the count and the unit (days, months, years).
  5. 5The button appends a further period row.
  6. 6The preview line immediately calculates with the sample record and shows the result.

For “today plus 14 days”, choose the system variable “Current date” in the first row.

Caution

For “First value of”, “Earliest of” and “Latest of” in the first row, watch the preview line. As far as we know, the window currently does not keep the chosen field there, and the variable stays empty even though the button shows the field. The same applies if, for “Variable”, you choose a field of a list with a summary. If the preview line shows “(empty)” although the sample record has a date, nothing is saved. For a date field of the printed record itself, this does not occur. There is currently no guided way to the first, earliest or latest date of a list.

Tip

If the count is to be a sum over a list, create the sum as a custom variable of the type Number (“Sum of”) and choose that variable as the count. As far as we know, the window does not take over a summary that you choose directly in the period; it then takes the list itself, and no date results from that.

Condition branches

With condition branches you define exceptions: “IF” a condition applies, “THEN” this value applies. This works the same for every type, including variables of a rule. This section describes how condition branches are built and how they are checked. The settings of the template also have condition branches; what is different there is described under Numbers, currency and dates: Condition branches.

  1. Under the box “CONTENT”, click “Condition branch” (symbol: diamond with a question mark). Above the base value an empty box appears with the header “IF”. The box “CONTENT” is now called “ELSE”: its value applies if no branch matches.
  2. In the box, build the condition as described under Conditions: The building kit: field, comparison and value. You append a second row with “Another condition”; only then do the AND/OR switch and “Subgroup” appear. For a choice field, you choose the value “by option value” among its options; the code of the chosen option appears next to it in small gray type (see Conditions: Choice fields: by option value).
  3. Under “THEN”, define the value. The same rows and buttons are there as in the base value, with its own “ƒx as formula”.
The window “New variable” with the name “Anrede” and the type “Text”. Below it “What should it contain?” and two boxes one below the other. The upper one begins with the blue heading “IF” and a red ✕ on the right. In it a condition box with the switch “AND” (chosen) | “OR” and a condition card: at the top the field selection “Rechnung › Kunde › Land”, below it the comparison “is” and the field with the value “Österreich”; at the top right of the card is a ✕. Under the card the buttons “Condition” and “Subgroup”. Further down in the same box the blue heading “THEN” and a row with “= | Fixed text | Grüß Gott” and a button to enlarge; below it the button “Text part” and on the right “ƒx as formula”. The second box carries the gray heading “ELSE” and contains a row “= | Fixed text | Guten Tag” with the same buttons. Under the boxes the button “Condition branch”, then the preview line “Result with the current sample data: Guten Tag”. At the very bottom “Cancel” and “Save”.
A text variable with a condition branch: Austria gets “Grüß Gott”, everyone else “Guten Tag”.
  1. 1A condition branch. The red ✕ removes the whole branch without asking.
  2. 2You build the condition as in the chapter “Conditions”: field, comparison, value, if needed several rows with AND or OR.
  3. 3THEN: the value that applies if the condition applies. The rows and buttons are the same as in the base value.
  4. 4ELSE: the base value. It applies if no branch matches.
  5. 5Appends a further branch, directly above ELSE. The check runs from top to bottom; the first matching one wins.
  6. 6The example has the country “Deutschland”; therefore the branch does not apply, and ELSE applies.
  • Order: The branches are checked from top to bottom; the first matching one wins. A new branch always goes at the end, directly above “ELSE”. Branches cannot be moved. To change the order, remove branches and create them again.
  • Removing: The red ✕ on the right in the header “IF” (mouse pointer: “Remove branch”) deletes the whole branch, without asking.
  • Incomplete branches: A branch with neither a condition nor a value is discarded on saving. A branch with a condition but an empty value is kept and supplies an empty value when it applies. In the condition branches of the template settings this is different: there, with an empty “THEN”, the built-in default applies, neither an empty value nor the fixed value (see Numbers, currency and dates: Condition branches). A branch with a value but without a condition always applies and hides all branches below it. If, on the other hand, a field is chosen in a branch but the condition is still incomplete, for example still without a value, the red note “⚠ Value missing: without a value, this branch would always apply. Choose a value or remove the condition with ✕.” appears under the branch and next to the buttons “⚠ Condition incomplete: branch …”; “Save” stays disabled until you add the value or remove the condition with ✕. A branch that is always to apply is therefore one without a field. The condition branches of the template settings disable “Done” in the same way in this case (see Numbers, currency and dates: Condition branches). “Save” also stays disabled if a condition contains a field in “{{ }}”, for example from an imported template: under the branch it then says “⚠ Typo: »{{ }}« does not belong in a condition; as written the field is not read at all. Rebuild the condition.” (see Conditions: Fields in “{{ }}”).
  • What the condition can read: For a custom variable, it is checked on the printed record and can read other custom variables. The field picker shows all fields and the custom variables; if you choose a Number variable, the comparisons for numbers are also available. It does not offer system variables here. For a variable of a rule, the condition is checked for each row (see Rules: What is different for a variable of the rule).
  • Condition written by hand: If a stored condition cannot be shown in the building kit, for example from an older or imported template, the box only displays it. How to replace it is described under Conditions: Conditions written by hand.

Example salutation (type Text): IF “Land is Österreich” THEN “Grüß Gott”, ELSE “Guten Tag”. Example color: IF “Betrag greater than 1000” THEN #d13438 (red), ELSE #2e7d32 (green).

The preview line

At the end of the window content, above the footer, a box with a colored stripe shows what the variable yields with the sample record (see The sample record). It recalculates after every change to the rows, to the branches and under “What should it look like?”.

  • Custom variable: “Result with the current sample data: …” with the value in bold. Number and Currency appear with the settings under “What should it look like?”, Yes/No in the language of the template, a date in the date format of the template. If the result is empty, “(empty)” appears in gray. The preview also calculates other custom variables that this one reads.
  • Variable of a rule: “Result on the FIRST row of this rule: …” (see Rules: Preview, saving, renaming and deleting).
  • Empty branches: A condition branch with neither a condition nor a value, for example one you have just created, does not count in the preview. It therefore shows what applies after saving, because “Save” discards such branches.
  • When the variable fails: The reason then appears in red with a warning sign in front, for example “The variable »Netto« uses itself.” or “The variables depend on each other: A → B → A.”, otherwise “The variable cannot be calculated.” Each is followed by “The value therefore stays empty — on the canvas and in the PDF alike.” If variables read each other in a circle, all of those involved stay empty.
  • When the variable reads a rule result: A note then appears below in red that begins with “»@Name« reads the result of the rule »…«.” What this means is described under When a custom variable is calculated.

A variable of the type Text remains text everywhere, even if it consists only of digits: the preview line shows a postal code “01069” with the leading zero, and a condition that compares with the text (“starts with”, “contains”) sees the same characters as the PDF. “Is equal to” with a value in quotation marks also compares text with text: “0049” is not equal to “49”. Without quotation marks (== 49) and with “greater than” or “less than”, digits continue to be read as a number.

Saving, renaming, deleting, messages

Saving

“Save” checks the variable in this order. If it finds something, a note appears at the top for a few seconds, and the window stays open:

  1. “Please enter a name.”
  2. “Please choose the type first.”
  3. “Condition branch 3: the condition is not complete yet — the branch would always apply. Please add the value or remove the condition with ✕.” In this case “Save” is already disabled beforehand (see Condition branches).
  4. Only for Color: “Not a valid color in ELSE: »…«. A hexadecimal code such as #d13438 is expected — or a field or a variable.” Instead of “in ELSE”, the note names the branch where applicable, for example “in condition branch 2”.
  5. “A variable with this name already exists.”

If everything is in order, “Save” silently adds a missing hash sign to a color, discards empty condition branches and closes the window. The area “Data”, the list in the window “Edit text”, open field pickers, the canvas and the properties then show the new state. With Ctrl+Z you undo the saving of a custom variable. The variable is stored in Dynamics only when the template is saved.

Renaming

If you change the name and save, the designer also changes all places where the variable already appears: in texts, including with a number or currency format, in date calculations, in conditions, in the branches of a dynamic text and in color fields to which a color variable is bound. It then reports the count, for example “Renamed: 3 reference(s) to »@Netto« updated — in placeholders, formulas and conditions.” Only a text that is currently open in the window “Edit text” is left out; apply it first.

Deleting

“Delete” on the left in the footer exists only for an existing variable. It asks “Delete variable »Name«? References to it print nothing afterwards.” and offers “Cancel” and “Delete”; Esc and a click next to it cancel. Places that point to the deleted variable then print nothing; in a Number variable it counts as 0. With Ctrl+Z you bring the variable back.

The check before full preview and PDF

Before the full preview or a PDF is created, the designer checks all custom variables. If it finds something, it asks under “Something is wrong with the custom variables:” and names each finding with its consequence:

  • Variables that depend on themselves or on each other; they stay empty.
  • “There are several variables named »…« — only the first one is used.” This can happen after an import, for example.
  • “1 variable has no name and is not used.”
  • “The variable »@…« does not exist — used in: …” A condition using it does not apply, even with a leading “!”, and the document contains a warning about it; in a text the place stays empty, in a Number variable it counts as 0, and in a date calculation no date results.
  • “In variable »…« there is a condition branch WITHOUT a condition before others — it always applies and switches off the branches below it.”

The same confirmation prompt also names condition branches without a condition in the template settings, for example “In template setting »Currency symbol« there is a condition branch WITHOUT a condition before others …”, custom variables in their conditions that do not exist, and a condition branch of the template settings whose own custom variable itself depends on the number format and would select a different branch when printed, likewise the value of a template setting, fixed or in a branch, that reads such a variable and would turn out differently when printed (“In template setting »Decimal places« the value reads the custom variable »@…«, … — a circle. …”; see Numbers, currency and dates: Condition branches).

You can go back into the designer with “Cancel” or continue with “Generate anyway”; “Generate anyway” is preselected (see Full preview and PDF: Confirmation prompt for rules and variables). Further messages are described under Problems and messages: Messages about variables and conditions.

Inserting a variable

Into a text

  • Dragging: Drag “@Name” from the area “Data” onto the page or into a text, like a field (see Data tree and field picker: The data tree).
  • Clicking in the area “Data”: A click inserts the variable at the text cursor into the input field of the properties that you clicked into last. If there is none, the message “First click into a text field — or drag the item in with the mouse.” appears.
  • In the window “Edit text”: A click on the variable in the list on the left inserts it at the text cursor, otherwise at the end of the text (see The “Edit text” window: Inserting fields).

On the canvas, the variable appears as a blue marker with its name, without the @ sign; point at it to see the placeholder. If the marker has received its own number, currency or date format, it is called “@Name”. The value is shown only by the full preview and the PDF. A custom variable has the same value everywhere, including in every row of a table.

Into a condition or another variable

  • Conditions: In the field picker of a condition, all custom variables of any type are under “Custom variables”. If you choose one, the comparisons depend on its type, for Number and Currency, for example, “greater than”. When the variable is calculated and what a filter can read from it is described under When a custom variable is calculated. How it appears in the condition and where it does not take effect is described under Conditions: Custom variables in a condition.
  • In another variable: Choose the kind “Variable” and, in the field picker under “Custom variables”, the one you want. This way you keep calculating with an intermediate result, for example “@Netto” times 1.19. For Date, a variable can be the first row or the count of a period.

Using a variable as a color

You insert a color variable into any color field: click the color swatch, then “ƒ Variable …” in the color picker and then choose the variable. This is described step by step under Border, background and colors: Color field and color picker, which also covers everything else about the color picker, for example about “unlink” and “No color”.

If the suitable variable does not exist yet, you create it in the same menu with “New color variable …”. The variable window opens with the type “Color”; the type can still be changed. What happens after “Save” or “Cancel” and why you close the window with its buttons, not with Esc, is described under Border, background and colors: Color from a variable (on Esc also Using the window).

In the window “Edit text”, you color a selected passage the same way via the color swatch of the toolbar (see The “Edit text” window: Color). If the variable currently yields no color, the passage keeps the color of its surroundings.

Custom variables in the area “Data”

The category “Custom variables” is in first place in the area “Data”, before “System variables”. The list in the window “Edit text” and every field picker that offers custom variables show the same category. Variables of a rule are not here but under their rule.

PartWhat it shows or does
Header “Custom variables” with ▸/▾Expands and collapses the category; in the area “Data” it is initially collapsed. Mouse pointer: “Values you define yourself — a fixed value, text or if-then.”
Button “+ New” on the right in the headerOpens “New variable” (mouse pointer: “Create a new custom variable”).
“None yet — create one above with »+ New«.”Appears as long as the template has no custom variable.
Entry “@Name”In front, a badge for the type: “Abc” for Text and Color, “123” for Number and Currency, “Date”, “Yes/No”. Mouse pointer: “Insert custom variable — edit with ✎”. Clicking or dragging inserts the variable; in a condition picker, the click chooses it for the condition.
✎ at the end of the entryOpens “Edit variable” without inserting (mouse pointer: “Edit variable”).
Search box “🔍 Search in »Custom variables«…”Appears from six entries on and searches only this category.

In a field picker that offers only certain types, only matching variables appear: a Currency variable counts there as a money field, Text and Color variables as text. If none matches, the category is missing entirely. If no data source has been set yet, the area “Data” shows only “Custom variables”, expanded, and below it “No data source yet. Click ‘⚙ Manage data sources’ above → set the primary source.”

If the template contains a building block, each one has a category of its own, “Building block ›Name‹”, with its variables, with the prefix in front of the name: “@Chancenkopf.Farbe”. Mouse pointer: “Insert the building block's variable — it is edited in the building block itself”. You insert them like a custom variable; there is no ✎, because they are edited in the building block. Only a building block brings the period in the name; the name field of a custom variable does not accept one. If a custom variable has the same name as the prefix of a building block, the designer warns, and the area of the building block stays empty (see Building blocks: The variables of the building block).

When a custom variable is calculated

A custom variable is calculated once for the whole document: after all data has been loaded and before the first rule runs. It follows that:

  • It has a value for the whole document, in the text as well as in every filter and in every table row.
  • It can read the fields of the printed record and calculate over lists, for example the sum of all items. Such a sum has the same value in rule filters, in rule formulas and in the text.
  • In a rule filter, its condition cannot read fields of the individual row, rule results or page numbers. If a filter compares only a variable with a fixed value, it therefore lets all rows through or none. Today’s date and the signed-in user, by contrast, can be used, the date also for calculations such as “today + 14 days”. Because the field picker of a condition does not offer system variables, create a further custom variable for this, for example “Heute” of the type Date with “Current date” in the first row, and choose it in the condition.
  • It does not know the results of rules, because the rules run only afterward. The field picker does show the rules. If you choose a calculated field of a rule there, the variable has two values: in filters and calculations of rules it is empty or 0, also in its own if conditions; in the text the rule result appears. The preview line points this out. Its note says at the end that the field picker does not offer rule results; at the moment, however, it does show them. It is better to use “Sum of” over the list itself.
  • Page numbers are not yet fixed during calculation; they appear correctly only in a variable of the type Text (see System variables).

This does not apply to a variable of a rule: it is calculated individually for each row of the rule, after the rule has filtered, summarized and selected (see Rules: What is different for a variable of the rule).

System variables

The system fills in system variables when the document is created, independent of the data source. They are in the area “Data” under “System variables”, directly under “Custom variables”, as soon as a data source is set. Mouse pointer on the header: “Values the system fills in automatically — independent of the data source.” In the area “Data”, the search box “🔍 Search in »System variables«…” is always under the header. If you point at an entry, the mouse pointer explains it.

System variable (badge)Marker on the canvasWhat appears in the PDF
“Current page” (123)“Page #”the number of the page, for example for “Page 1 of 5” in the footer
“Total pages” (123)“Pages ∑”the number of pages of the finished document
“Current date” (Date)“Current date”the date on which the document is created, in the date format of the template, for example “04.08.2026”; the format can be chosen per field by double-clicking (see Numbers, currency and dates: The date format of a single field)
“Current time” (Abc)“Time”the time of creation as ready-made text in the short form of the template language, for example “14:30”; not a date
“Date & time” (Date)“Date & time”both together, for example “04.08.2026 14:30”, in the format for date and time of the template
“User” (Abc)“User”the full name of the user who creates the document
  • Inserting: Drag or click a system variable in like a field, also in the window “Edit text”. On the canvas the marker always appears, never the value; only creating the document inserts the value. If you have given the marker its own name in the window “Edit text”, it shows that; the same is printed. In older templates the markers “Date” and “Date/Time” may also appear; they print the date or the date and time of creation.
  • Time: Date and time apply in the time zone of the user who creates the document (see Numbers, currency and dates: Date & time).
  • Page numbers: Where they apply, including in tables, and which number an object split across two pages shows, is described under Page numbers.
  • In custom variables: Which system variables the field picker offers for each type is described under The button “Choose field …”. Page numbers make sense only in a variable of the type Text. Number, Currency and Date variables do not offer them and calculate without them; the picker of a color variable does show them, but they do not yield a color there. A Date variable is always printed in the date format of the template, the format for pure date values, that is, without time, even if it begins with “Date & time”. A time appears only if a pattern of its own with a time is entered there (see Numbers, currency and dates: Date & time and Numbers, currency and dates: Custom pattern). “Current time” is text and is not available for selection in a Date variable.
  • Not available: system variables in the field pickers of conditions and rule filters and in the field picker of a variable of a rule. Without a data source, the category is missing entirely.

What changes in the document?

On the canvas

A variable appears as a blue marker with its name: a custom variable without the @ sign, a system variable with its fixed name such as “Page #”. The value is shown only by the full preview and the PDF; a color variable, by contrast, already colors the page, with the value from the sample record, and if no color results, the canvas shows the color under “ELSE”, and the PDF then draws none (see Border, background and colors: Color from a variable). Visibility rules with a variable do not take effect on the canvas (see Visibility: What changes in the document?).

In the PDF

At every place the calculated value appears: for a custom variable the same one everywhere, for a variable of a rule the value of the respective row, for a system variable the value at the time of creation. Number, amount, date and Yes/No appear according to the template settings or according to the exception on the variable. Which condition branch applies is decided by the real data.