# Document Templates

## Introduction

The Template Designer allows users to create standardized documents like letters or reports and fill them dynamically with information. So, repeatedly reports or personalized letters to a variety of receivers can be created with ease.

In this article we will introduce you to the versatile features of the Template Designer.

## Manage Templates

You can edit, delete, and clone templates, or export your template definition as well as texts for use in another app. Head to your **Workspace > Apps** and click on the gear icon<img src="https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MBCeOhqzSg8dBSFcJSA%2F-MBCo7T7BtG64Zwffv31%2Ffa-cog.png?alt=media&#x26;token=7b190f6b-19e5-4dea-8eaa-3bf0e53fa641" alt="" data-size="line"> to activate the configuration mode of your apps. Next, navigate to the app you want to configure and click on the gear icon<img src="https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MBCeOhqzSg8dBSFcJSA%2F-MBCo7T7BtG64Zwffv31%2Ffa-cog.png?alt=media&#x26;token=7b190f6b-19e5-4dea-8eaa-3bf0e53fa641" alt="" data-size="line">. In the **Views** section you click on **Templates** to access the list of existing templates.

![Access the Template Designer in your apps](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1b2AR3AyeyJmydTdz%2F-MJ1m_KiHMbgbOy5eoD5%2FTemplates_Launch.gif?alt=media\&token=9c96c72e-193d-4cd6-9ddb-b7abf116f08d)

### Create a Template

Click on **New Template** to create a new template definition to use in your application. [Get Started with Template Designer](https://docs.tivity.one/building-an-application/views/document-templates/get-started-with-template-designer) describes the process of creating a document template in detail.

### Edit a Template

Click on the template name from the list to open the template designer. The remaining functionality is identical to creating a new template, as described in [Get Started with Template Designer](https://docs.tivity.one/building-an-application/views/document-templates/get-started-with-template-designer).

![Edit a template and validate before saving](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1mm9VbKAfW6YCjLz6%2F-MJ1p6kE4CqkqOTYOqwt%2FTemplates_Edit.gif?alt=media\&token=a66d528f-80fd-4ea0-b42b-23e46922c784)

Modify your existing template as needed, optionally **Validate** the current definition, and click **Save** to store your changes.

### Delete a Template

Either you open the drop-down menu on the right-hand side to the template name and choose **Delete** or you click on the template name from the list and click on **Delete** to remove the template.

![Delete a template from your application](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1mm9VbKAfW6YCjLz6%2F-MJ1qFsY5bMXVe2Syxyn%2FTemplates_Delete.gif?alt=media\&token=55b87c40-eec2-4c83-a63d-710fb7977b8a)

Confirm to delete the selected template with a click on **Yes, delete it**.

### Clone a Template

In scenarios where you need the same template with minimal variations you don't have to create each template from scratch but you can duplicate an existing one. Open the drop-down menu on the right-hand side to the template name from the list and choose **Clone**.

![Duplicate an existing template to speed up multiple configurations](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1rAOqEscPMiPKhenh%2F-MJ1sLGQrZi-MqEKt-bH%2FTemplates_Clone.gif?alt=media\&token=6762e0f2-f1cf-48b0-a9b9-4ed2dad70af5)

After a short while a new template with a `- Copy` suffix will be added to the list of templates. You can create multiple copies of the same template.

{% hint style="info" %}
Prior to be able to clone a template it has to be validated successfully. If the copying process fails, open the template for review and validate it.
{% endhint %}

## Used By

Apart from being able to create and manage templates it is interesting to know whether and how a particular template is used in an application. Open the drop-down menu on the right-hand side to the template name in the list and choose **Used By**.

The Template Designer shows you in which Layouts, Classes, Functions, Selections, Templates, and Workflows the selected template is used.

![Used By provides you information where a template has been used](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1rAOqEscPMiPKhenh%2F-MJ1t7L4YeOgRY8k6hbI%2FTemplates_UsedBy.gif?alt=media\&token=95ebc7c5-74b0-4956-8bbe-80322c0ff0f0)

Click on **Close** to return back to the list of templates.

## Export Templates

To save your templates for backup or to transfer templates between applications and workspaces you would export them. Open the drop-down menu on the right-hand side to the template name in the list and choose **Export**.

![Export your templates for backup or for use in other applications](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1rAOqEscPMiPKhenh%2F-MJ1uKcX27xcnbJptfxR%2FTemplates_Export.gif?alt=media\&token=8233a7f5-c844-43dd-8c93-74bd8800386f)

The platform is going to assemble a ZIP archive and will offer you to download it to your system. The default file name is `templates.zip`.

{% hint style="info" %}
The generated ZIP archive is potentially password-protected.
{% endhint %}

## Import Templates

{% hint style="danger" %}
ToDo: Import fails due to invalid format of previously exported templates file.
{% endhint %}

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 **Import Templates**.

Next, either drop an exported file from your system into the designated area or click on one of the available options to import your templates. Click **Execute** after the file has been uploaded completely.

![Import of templates to transfer definitions between apps](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1uS1FEdatCaKhoW8B%2F-MJ1vfGW1gTo40e2Mew7%2FTemplates_Import.gif?alt=media\&token=8fdee2b3-8956-41ca-a525-ae71b6505879)

After successful import the templates either have been created as new entries based on their original name or the suffix `- Copy` has been added to any existing template to avoid name conflicts.

## Export Texts

{% hint style="danger" %}
Functionality is broken at the moment.
{% endhint %}

![](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1uS1FEdatCaKhoW8B%2F-MJ1wk-1NKDi39ZdhBSW%2FTemplates_ExportTexts.gif?alt=media\&token=a83264f5-627a-4c1b-93fc-f6b4da27c80c)

...

## Import Texts

{% hint style="danger" %}
Functionality is broken at the moment.
{% endhint %}

![](https://2608258621-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8HTRblOKav_qm4KEx6%2F-MJ1uS1FEdatCaKhoW8B%2F-MJ1xf10-iScpFhKWfM6%2FTemplates_ImportTexts.gif?alt=media\&token=e5b13aba-c646-4675-a983-19b060020c34)

...

## Return to the Workspace

After you completed your changes in the Template Designer you scroll down to the bottom of the **Config Mode** in the left-hand side Workspace pane and click on **Leave Config Mode**. Then you click on the tick next to the **Apps** caption to return to your Workspace.

## More on Template Designer

Working with document templates...
