# Using variables in templates

Step 3: adjusting the Bas configuration · Updated: 2026-02-07 · Bas Software
Web version: https://www.bas.software/en/onboarding/step-3-adjusting-the-bas-configuration/using-variables-in-templates

Learn how to use variables in your templates to automatically fill in dynamic fields with customer details, addresses and document numbers.

Variables are dynamic fields that the system automatically fills in with details from the case file. Instead of manually typing "Mr Jansen", you use a variable that automatically fills in the correct name on every quote or invoice.

This makes your templates reusable: one template works for all customers, all case files and all documents.

---

## How do you add a variable?

1. Click in a **text block** where the variable should go
2. Click the **Variables** button in the toolbar (dropdown with a down arrow)
3. Choose a **category**: Identity, Customer, Quote, or Move
4. Select the desired **variable** from the list
5. The variable is inserted at your cursor position

You don't need to memorise any codes. The list shows all available variables per category.

---

## Available variables

### Identity (your company details)

These variables show information about **your company**:

| Variable | What it shows | Example |
| --- | --- | --- |
| Address | Full company address | Example Street 10, 1234 AB Amsterdam |
| Company name | Name of your company | Example Removals B.V. |
| VAT number | Your VAT number | NL123456789B01 |
| Email | Company email address | info@voorbeeldverhuizingen.nl |
| IBAN | Bank account number | NL00BANK0123456789 |
| Chamber of Commerce number | Chamber of Commerce number | 12345678 |
| Logo | Your company logo | (image) |
| Mobile number | Mobile phone number | 06-12345678 |
| Phone number | Landline phone number | 010-1234567 |

### Customer (customer details)

These variables show information about the **customer**:

| Variable | What it shows | Example |
| --- | --- | --- |
| Salutation | Form of address | Mr / Mrs |
| Last name | Contact person's last name | Jansen |
| Company name | Company name (business customer) | Jansen Administratie B.V. |
| VAT number | Customer's VAT number | NL987654321B01 |
| Email | Customer's email address | jan.jansen@example.com |
| Billing contact | Billing contact name | (dropdown with sub-variables) |
| Invoice address | Invoice address | (dropdown with sub-variables) |
| Main contact | Main contact name | (dropdown with sub-variables) |
| Customer number | Unique customer number | KL-2026-042 |

**Sub-variables for addresses:** Invoice address and Main contact have sub-variables such as street, house number, postcode, town/city, etc.

### Quote

These variables show information about the **quote**:

| Variable | What it shows | Example |
| --- | --- | --- |
| Quote number | Unique quote number | OFF-2026-0042 |
| Reference | Optional reference field | Proj. Herengracht |
| Total incl. VAT | Total amount including VAT | EUR 2,450.00 |
| Expiry date | Date until which the quote is valid | 22-01-2026 |
| Free text fields | Custom text fields (see below) | (dropdown) |

### Move

These variables show information about the **move case file**:

| Variable | What it shows | Example |
| --- | --- | --- |
| Case file number | Unique case file number | DOS-2026-042 |
| First move appointment date | Date of first appointment | 15-04-2026 |
| First move appointment time | Time of first appointment | 08:00 |
| Loading address | Address where loading takes place | (dropdown with sub-variables) |
| Last move appointment date | Date of last appointment | 16-04-2026 |
| Last move appointment time | Time of last appointment | 17:00 |
| Unloading address | Address where unloading takes place | (dropdown with sub-variables) |
| Notes for the customer | Special points of attention | Lift available, narrow staircase |

**Sub-variables for addresses:** Loading address and Unloading address have sub-variables for street name, house number, postcode, town/city, country, etc.

---

## Free text fields

In addition to the standard variables, you can also create **free text fields**. These are custom fields that you fill in differently for each case file.

### When do you use free text fields?

- For information that **doesn't fit in a standard field**
- For **optional extra information** that isn't always relevant
- For **text customised per case file** (e.g. "Disposal of old furniture: 3 sofas")

### Creating a free text field

1. Open your template in the editor
2. Click in a text block
3. Type the following code:

```
######{{quote.freeText['your title here']|nl2br}}
```

**Examples:**

```
######{{quote.freeText['Disposal']|nl2br}}######{{quote.freeText['Additional services']|nl2br}}######{{quote.freeText['Comments']|nl2br}}
```

The text between the quotes (`'Disposal'`) is the **name** of the field. You'll see this name later in the case file as a label, but it does **NOT** appear in the final PDF.

### Filling in a free text field

When you generate a quote or invoice for a case file:

1. Click the **pencil icon** on the right of the document
2. You'll see all the free text fields included in the template
3. Enter the desired text
4. Click **Save**

The text you entered automatically appears in the correct place in the PDF.

### Important information about free text fields

`Note:` Only change **the text between the quotes**. If you change anything else in the code (the curly braces, `|nl2br`, etc.), the variable stops working.

**This is fine:**

```
######{{quote.freeText['My own field name']|nl2br}}
```

**This breaks the template:**

```
######{{quote.freeText[My field]|nl2br}}        # Quotes forgotten######{{quote.freeText['Test'}}                   # |nl2br forgottenquote.freeText['Test']|nl2br                # ######{{ }} forgotten
```

---

## Variable syntax

Variables use **double curly braces** as syntax: `######{{ variable }}`.

### Spaces are required

There must be a **space** between the double curly braces and the variable name:

**This works:**

```
######{{ quote.loadAddresses|trans }}
```

**This does NOT work:**

```
######{{quote.loadAddresses|trans}}
```

If you insert variables using the **Variables** button, the correct syntax is applied automatically. But if you type or copy variables manually, pay attention to the spaces.

---

## Example: quote text with variables

This is what a typical quote text looks like in the editor:

```
Dear ######{{ contact.salutation }} ######{{ contact.last_name }},Further to our appointment, please find enclosed aquote for your move from######{{ quote.loadAddresses|trans }} to ######{{ quote.unloadingAddresses|trans }}.Thank you for the opportunity to provide this quote.
```

For a real case file, this automatically becomes:

```
Dear Mr Jansen,Further to our appointment, please find enclosed aquote for your move fromExample Street 10, 1234 AB Amsterdam toNew Street 5, 5678 CD Utrecht.Thank you for the opportunity to provide this quote.
```

`Tip:` Always place variables on the same line as the surrounding text. If you put variables on separate lines, you'll get unwanted white space in the PDF.

---

## Multilingual templates

If you have international customers, you create separate templates per language.

### Available languages

Available by default: **Dutch** and **English**. Additional languages (German, French) are also possible.

### Process

1. Get your **Dutch template** perfect
2. Click **New template** and choose **"Based on"**
3. Select your Dutch template as the basis
4. Translate all **text** into the desired language
5. The **variables stay the same** - they automatically pull in the correct data
6. Give the template a clear name: "Quote English" or "Invoice English"

### What do you translate?

| Element | Translate? |
| --- | --- |
| Body text ("Dear...") | Yes |
| Headings ("Quote", "Total") | Yes |
| Variables (`######{{ contact.last_name }}`) | **No** |
| Free text field labels | Yes (the name between quotes) |

---

## Tips

- **Use the Variables button** instead of typing manually. This way you can be sure the syntax is correct.
- **Place variables on the same line** as the surrounding text. Prevents white space in the PDF.
- **Test with a real case file.** Create a test case file and generate a quote. Are all the variables filled in correctly?
- **Free text fields for custom information.** If there's no standard variable available, create a free text field.
- **Labels of free fields don't appear** in the PDF. Only the entered text does.
- **Variables work in every language.** You only translate the body text, not the variables.

---

## Note

- **Variables without a space** don't work. Pay attention to the space between `######{{` and the variable name.
- **Empty variables** mean the field hasn't been filled in in the case file. Check that all required fields have been completed.
- **Variables on separate lines** cause extra white space. Keep them on the same line.
- **Don't change the free text field code** except for the text between the quotes. Otherwise the variable breaks.
- **Duplicate templates using "Based on"** for multilingual versions. Saves a lot of formatting work.

---

**Next step:** Invoice and job sheet template
