Skip to Content

Configuring an Export Template

CMW Tracker supports the ability to export records to Word, Excel or PDF files. In order to configure that, you need to first create a template, in the form of an either Microsoft Word or Microsoft Excel file and map CMW Tracker fields to specific places within that document/workbook.

To configure an export template file:

1. Create a new Microsoft Word/Excel document/workbook (*.docx or *.xlsx) which will be the export template file.

2. Create your template layout, entering labels for the data you want to export from CMW Tracker.

3. Fill the template in with the system names of the fields that are to be replaced with actual data upon export. You can use the following syntax for your templates:

Pattern Description
{field_identifier} returns a value of a text field
{#field_identifier} returns a value of a field of the Reference type
{attachments} returns a list of attachments
{*attachment} returns attachments (pictures and PDFs) as pictures
{*reference_field_identifier->attachment} returns attachments (pictures and PDFs) as pictures, from referenced objects

where «field_identifier» and «reference_field_identifier» are the field identifiers which you can find in the fields' settings: «Application» setup > «Fields» > double click on the field name.

4. Design a nice look for your template: apply styles, configure fonts, add your company logo into it etc..

5. Save the export template file.

See also: Uploading a Template File into CMW Tracker.

 

In order to export data from multiple records referenced via a reference field in the form of a table, use the below example to create a table in your Microsoft Word-based template (Microsoft Excel-based templates do not support this syntax):

Column 1 Name Column 2 Name Column 3 Name Column 4 Name
{foreach:reference_field_id}{field_1_id} {field_2_id} {field_3_id} {field_4_id}{end:reference_field_id}

Use the first row of the table to name the columns of your table. The second row is used to map the columns to the fields you need to extract data from upon export:

  • The first cell of the second row is where you need to specify the identifier of the reference field you need to pull the data from, with the help of the «foreach» operator. It has to be followed by the identifier of the field (from the referenced application) that will supply data for the first column;
  • All the cells in columns between the first and the last one should contain the identifiers of the corresponding fields from the referenced application;
  • The cell in the last column should contain the field identifier for this last column, followed by the "closing" tag that uses the «end» operator and once again the identifier of the reference field.

Make sure you don't have any spaces between any of the tags and symbols when configuring the table. 

In order to export a list (only supported for Microsoft Excel-based templates):

  • Go to the settings of your export template and add «Template variables» corresponding to lists that you want to export in the template;
  • Go back to your Microsoft Excel template and insert the name of the variable you created at the previous step using the syntax of: «{%variable}». 
You can also enable the «Use report template» option in export template settings and insert variables that use N3 expressions in the template using the syntax of: «{~variableN3}».