With this feature, you can create Word Documents and PDFs containing instance data from forms and with instance variables. 


1. Prepare and save a Document Template on your computer by creating a Word Document (.docx) containing variable references, for example $form.field$. For more information on how to use and reference variables see this article.


2. Upload the saved Document Template via the asset browser.




3. Drag and drop the Document Template from the asset browser either to a user task or to the Generate Document from Template Script Task. In the user task it is available as a preview to download but will not be generated and added to the content folder until the task is completed. This allows users to make changes to an associated form in the user task and then upon completion generate the Word Document which can now reference and collect any of the changed form data from that user task. Once the document is generated it will be added to the instance content folder.

NOTE: As both outputs reference the same Document Template it will be overwritten each time it is modelled as an output. If you want to keep track of diferent versions of the same Word Document throughout the process, you must add a different template reference each time you wish to generate a new document in order to not have it overwritten.



4. If you instead model the association as an input to a User task, it will be visible in the task view provided it exists but will not be generated anew when the task is completed. 


Configure your Document template

There are a number of options available by double clicking the Document Template symbol.

 

Move generated document - Allows you to specify a directory in your content folder where you wish the generated Word Document to be placed. If the directory does not exist it will be created.

NOTE: You can also use variables to set the folder name.


Custom name - Allows you to set a custom name for the generated Word Document. Custom name can contain variables. 


Generate PDF - Generates the Word Document as a PDF.


Change association name

You can double click the arrow and name the association. This will then be shown in the task view.