Word Templates

Word Templates

Our platform allows you to export Data in the layouts you want using Microsoft Word templates or Excel
If you already have Word documents that you have been printing out to use as data capture Forms, you can reuse them as data templates with a few minor changes.
This functionality works similarly to a Microsoft Word “mail merge” in that the system produces output based on pre-formatted templates. 
The template contains the static (non-changing) text, images, and formatting needed for the final output.  
It also includes placeholders where Form entry answers will go. 
For example, imagine you have an Inspection Form and want to export the Inspection Data captured on the app as a standard letter.
You could create a Word template that sets out the standard text of the letter along with placeholders for where various Inspection answers should go. 

Want to jump straight into the deep end? Take a look at our “kitchen sink” template file attached at the bottom of this article.


Adding a Template to a Form

  1. Identify the Form requiring a custom output template.
    If you don’t already have a form, you can quickly create it using the Form Screen Designer.
  2. Create a new or use an existing Word file.  
    If you already have Word files you’ve been printing to use as data capture Forms, these can easily be reused as a template.
  3. Go through your Word template and insert placeholders wherever you want the system to insert answers from data entries of your chosen Form.
    Placeholders are entered using the unique data name of the Form field, wrapped in curly braces – e.g. {{dataname}}So, for example, if your Form has a field with the data name of “LastName”, then you can instruct the system to inject the answer for this field wherever the placeholder {{LastName}} appears. The system will honor any formatting (font, color, highlighting, size, etc.) you apply to the placeholder and apply it to the answer value inserted. 
  4. Once you have inserted all the placeholders needed, upload the Word template file to your Form screen.
    There are two places where you can add a template to a Form:
  • Form Level

If you add a template at this level, you are instructing the system to use this template as the default whenever a PDF is generated.

Upload your template using the “Word Template” field in your Form’s Settings page.

  • Connector Level
    This template is specific to one or more Connectors but should not be used as a default. Upload your template using the “add data template” link on the appropriate Connectors in your Form’s Connectors page.

Uploading a template also makes new export options available in the Data area.


Testing Your Templates

Assuming you have at least one existing Form data entry, you can test your templates reasonably quickly by using the Data Entries area (you can find entries in either feed or table view).

Find a data entry from the form whose data you would like to output in a template. Hover over that row and click the Export Data option to generate a file output.

A pop-up will allow you to select a built-in or custom template associated with the form.


Troubleshooting / Common Issues

In this section, we will try to provide solutions and workarounds for known issues you may encounter when working with Word templates.

Unable to open generated .docx file output

If your generated docx output does not open in Word and gives errors such as “unreadable content” or “file is corrupt and cannot be opened“, the issue is likely the .docx template used in your Word data template.

It usually means that your Word document is linked under the hood to an inaccessible .docx file (usually located on your PC or a network drive).

Because this linked .docx file is not available to the Appenate platform when it generates the file output, the system throws this error to alert you of the missing data.

To fix this issue, you must clear the .docx template of your Word file. This will let the Word file default to the standard “Normal” .docx template.

Follow the steps below to clear the problem .docx template:

  1. In MS Word, display the Developer tab in the Word ribbon and navigate to the Developer tab.
  2. Click the Document Template tool. Word displays the Templates and Add-Ins dialog box.
  3. Clear any text found in the Document Template field (even if it says “Normal”).
  4. Click OK to reset the Word doc to have no required/attached .docx.
  5. Close the dialog and save your Word template.

Merging Tables Vertically

If you’re attempting to use a template that has table cells merged vertically, please note that this can cause “null ref” errors when our platform tries to use that template to render your data output. The only solution in this instance is to redesign your template so that it does not make use of any vertically merged table cells.

Output from the template results in a very large file

When exporting data entries that result in very large PDF outputs, check the following:

  • Ensure that your Word doc does not embed all fonts within the document. In Microsoft Word, do the following: Go to File > Options > Save > (Uncheck) Embed fonts in the file
  • Ensure that the “High-Resolution Images” option is not checked in your form or connector settings.
  • Ensure that the data entry you are exporting does not have excessive images.

Example Template – “Kitchen Sink”

If you’re the kind of person who likes to jump straight into the deep end, then take a look at the attached docx file below 

This is a “kitchen sink” example of most of our functionality for Word data templates.

We strongly suggest you read the other topics in this section to understand how the functionality in the example template works.

 

    • Related Articles

    • Excel Templates

      Our platform allows you to export Data in the layouts you want using Microsoft Excel templates. If you already have Excel documents that you have been printing out to use as data capture Forms, you can reuse them as data templates with a few minor ...
    • Charts in Templates

      Charts in Excel or Word are not officially supported in our data template functionality. We are aware of some customers having success generating basic charts within their data templates, however this is very much on a case by case basis. If you have ...
    • Built-In Templates

      Our platform offers a few built-in templates that can be used when exporting form-captured data in PDF. Even though you can fully customize your outputs using Word or Excel files, the following new and improved built-in templates may come in handy ...
    • Custom Templates FAQs

      Can I use Word/Excel 2003? No. We support .DOCX and .XLSX files only which means that Office 2003 formats (.doc and .xls) are not supported. Note that we also do not support Word .dotx files and .xlsm (these are special Word/Excel file types.) Can I ...
    • Using Formulas in Templates

      The platform has the ability to evaluate formulae just like those you would use in your Forms. You can read all about what a formula is and how to create them in the Form Screens documentation. Being able to use a formula on your data output unlocks ...