Document Templates – Using Tags in ODF/OOXML Templates

Template Management

For example the Word (.docx, .rtf) and Excel (.xlsx) files and PDF and Open Document format files can be used as document templates for quotes, sales orders, invoices, support tickets, campaigns and invitation events. The templates can be prefilled with images and text. In addition, you can use different tags in the document to include information from the fields of the CRM modules.

An admin can manage the document templates in Settings → Document Templates.

The tags can be used in ODF/OOXML templates and when used in the system, they will be replaced with the input in the field of the entity. You can use the information in the fields of the module the template is linked to and of the modules that are linked to the original module (e.g. Account, Contact, User etc.).

To prevent the data from overlapping in situations where the module has a relation to self or there are multiple relations to the same module, you can use parameters in the document template to specify more precisely where the wanted data is fetched. For example, you can specify that the account name is fetched from the account by using the following parameters:


In the table below, there are a few examples on how the tags can be used. There are two formats of the tags, either one can be used. NB! In the document templates of Trouble Tickets module, only the form [module.field] can be used.

Created time
Valid until (date)
Account’s name
Contact’s first name
Contact’s last name
User’s first name
User’s last name
Custom field of Quotes module (check names always from the CRM supplier)
Sales order’s number
Sales order’s subject
Purchase order’s subject
Duedate of invoice
All the comments from support ticket
Ticket number
Creator’s username
Assignee’s first name
Assignee’s last name


The row data of the entity can be linked to the document with the following tags:

Product number
Product name including both products and subproducts*
{{rows.productname;block=tbs:row;when {{rows.type}}!='sub'}}
Product names only*
{{rows.productname;block=tbs:row;when {{rows.type}}='sub'}}
Subproduct names only*
Product description (row description)
{{rows.listprice;frm='0 000,00'}}
List price
{{rows.discount_total;frm='0 000,00'}}
Total discount
{{;frm='0 000,00'}}
Price (includes discount)
{{rows.grand_total;frm='0 000,00'}}
Total price
(includes VAT and discount)
{{rows.discount_percent;frm='0 000,00'}}
Discount percentage
{{rows.discount_total;ope=div:{{rows.qty}} ;frm='0 000,00'}}
Discount per unit

*If you need the document to automatically add rows according to the row data (e.g. the products are itemized on an invoice), the row tags must be inserted into a table.


You can also include a custom row field to the document using the name of the field. For example:

Field’s name: cf_lis_ale
Field’s name: cf_ean_koodi


The ‘total’ rows of the invoices, quotes, sales orders etc. are marked with the following tags:

{{total_row.total_no_sub;frm='0 000,00'}}
Total with discount (no sub-products included)
{{total_row.total_before_discount;frm='0 000,00'}}
Total before discount
{{total_row.discount_total;frm='0 000,00'}}
{{;frm='0 000,00'}}
Total with discount
{{total_row.total_tax_no_sub;frm='0 000,00'}}
Tax (no sub-products included)
{{total_row.total_tax;frm='0 000,00'}}
{{total_row.grand_total_no_sub;frm='0 000,00'}}
Total (includes tax, no sub-products)
{{total_row.grand_total;frm='0 000,00'}}
Total (includes tax)

These tags include the formatting of the number (;frm=’0 000,00′), but it can be left out as well.

To have the information replacing the tag in upper case letters, the following extensions can be used:

  • ;ope=upper (converts all the letters to upper case). For example: {{;ope=upper}}
  • ope=upper1 (converts the first letter of the first word to upper case)
  • ope=upperw (converts the first letter of every word to upper case).

A tag that refers to a checkbox typed field will show the value of the field, which is 0 or 1. To change the text shown, the following extension can be used:

  • ;if {{field}}=0;then No;else Yes (if the field hasn’t been checked, the tag will show “No”. If it is checked, “Yes” will be shown). For example {{;if  {{passive}}=0;then No;else Yes}}.


The pictures below show an example on how the tags can be used. The first picture represents the original template:


The other picture below shows the result, when the template is used with an invoice:

Module Tools
Document Templates – Convert ODF / OOXML to PDF
Managing and Creating Document Templates
Document Templates – Using Tags in ODF/OOXML Templates
Document Templates: Certificate Templates
Combined Shape