Get started with Template Designer

The article gives a brief tutorial about how to create a document template using the Template Designer.

Create a Template

Navigate to your Workspace > Apps and click on the gear icon to activate the configuration mode of your apps. Next, click on the gear icon of the app you want to configure. In the Views section you click on Templates to access the Template Designer. Click New Template.

Create a new template in the Template Designer

A template contains various sections to detail the purpose and content of the document. The following paragraphs describe each section in details.

General

Every template needs some general information about its purpose. Those properties are defined in the General section of a template.

Key

Optionally, you can give your query a Key or match code. This property can be helpful in other drop-down or selection menus in your app to quickly access and choose a template. In the list of templates the value of Key is shown in parentheses behind the name of the template.

The Key is a unique distinction between templates which is displayed in the Template Designer, but will not be visible to the end user in the finished app.

Name

The name of the template with that it is represented.

Templates can be given a language-specific name

Using the globe symbol on the right-hand side allows you to add or modify language-specific values of the property. Click again on the globe symbol to collapse the section.

Description

Provide fellow users a description of the template to explain what the template is designed for.

Description of a template in multiple languages

Using the globe symbol on the right-hand side allows you to add or modify language-specific values of the property. Click again on the globe symbol to collapse the section.

Template

Class

A template is valid for one class. Choose for which one.

Choose a Class to assign to the template

You have to specify a Class to validate your template.

Valid On

A template can be applied on a class, which means on all instances at once or on one instance only.

Template Script

To create an individualized template, the Template Designer allows users to specify scripts that create and enable the template execution. For more information on how to work with scripts on TIVITY see the documentation for the Script Designer.

In the Script for the template the variable that are replacing the placeholders in the document must be defined. Therefore, they must be named and spelled exactly the same way. Within this script, it must be defined how these data fields are filed.

For example, which data is used for the variables. As explained in the documentation on the Script Designer, different data inputs can be used and expressions for calculating and evaluating variables can be defined. This way a sophisticated report or form letter can be created.

Document

A template can be classified based on the following three types: Internal Document, External Document, or External Placeholder.

Specify the document type used in the template

Internal Document

Create a document as template within the TIVITY platform by using a Script.

Internal Documents are created within the TIVITY platform. Use this type if only a script is used to return the needed Information. You don’t need to upload a document with placeholder instead create a script and the return of the script will automatically convert to a PDF.

External Document

Upload a Word document as template. Therefore add placeholders in this document, so the designer can fill them out with data entries from the platform.

External Documents are Word documents that can be created outside of the platform and then be uploaded in the Template Designer. When the Template Designer is executed, it then automatically checks the document for placeholders and replaces them with the related data in the platform. Then, a new Word document is created with the new data inside.

Attach an external document to the template

Click on the Upload icon to upload a new external document. To check the document of a template, click on the Download icon to download it.

External Placeholder

Upload a PDF document with form fields and fill this fields with values from an Instance. Using a script to match PDF form fields with internal fields.

Use External Placeholder if there is a PDF document with form fields which should be filled with values from an instance. Upload a document with form fields, after that click on Open script icon. The form fields of the PDF documents will be displayed as variables in the script. Inside the script fill these variables with internal values. After that you can use the template and the platform will file the form fields with the values according to the instance and create a PDF document.

Assign external placeholders via a document to the template

Click on the Upload icon to upload a new external placeholder document. To check the placeholder document of a template, click on the Download icon to download it.

Advanced

Parent Template

To enable the inheritance of templates, a parent template can be chosen among the existing templates within the app.

Templates can be derived from another template

Parameters

Add Parameters that will requested when the Template is used. You can use parameters to hand over variables to a workflow/function that is used in the template.

Every template can have assigned specific parameters. These are variables that can be utilized within the template script. Here, different input or output variables for executing the template can be defined.

Use parameters to customise your template

In the properties of a parameter, various points can be defined. Next to the name and description the variable type can be defined or whether this field is required before execution, its default value and what error message is prompted otherwise.

Edit properties of a template parameter with more details

Control type

The available types are described in more detail in Data Modelling under page Field.

Field

Validate and Save a Template

The validation automatically checks whether the settings of the template are valid and provides notifications when there are errors.

Finally, click on Validate to verify that your selection of criteria is accepted by the Template Designer. Click on Save to store your template and return back to the list of templates in your app.

Last updated

Was this helpful?