# Managing Task Mining templates

> With **Template management** you can upload custom templates for exporting the trace diagram in Microsoft Word format across all Task Mining projects in the current tenant. Template management allows you to customize templates to align with your business needs, such as incorporating your company logo and branding.

## Introduction

With **Template management** you can upload custom templates for exporting the trace diagram in Microsoft Word format across all Task Mining projects in the current tenant. Template management allows you to customize templates to align with your business needs, such as incorporating your company logo and branding.

:::note
Currently, only Task Mining projects support Template management. Other types of projects use the UiPath default template for exporting a trace.
:::

:::important
To manage Task Mining templates on the tenant level, you need to have the Tenant Administrator platform role, or the Administrator service-level role in Task Mining
:::

## Uploading a template

:::important
Always make sure the structure of the Word template is correct and contains the recommended placeholders. Refer to the official Microsoft documentation on [Content Controls](https://support.microsoft.com/en-us/office/about-content-controls-283b1e29-0b77-4781-b236-2d02c1cce1c2#:~:text=Click%20File%20%3E%20Options%20%3E%20Customize%20Ribbon.%20In,to%20add%20from%20the%20Developer%20tab%20%3E%20Controls.) and [Working with Content Controls](https://learn.microsoft.com/en-us/office/vba/word/concepts/working-with-word/working-with-content-controls) for more information on creating templates using content controls. Tip: To create a new template and reuse placeholders, you can download the Default Template from Task Mining. Open it, and locate the placeholder you want to use. Copy the entire content control (not just the text inside it), and paste it into your new template to ensure proper functionality.
:::

To upload a custom template, take the following steps:

1. In **Task Mining**, go to **Administration**, and select the **Assisted Task Mining templates** tab.
2. Select **PDD** if youwant to manage templates for downloading Process description documents (PDD) or select **SOP** if you want to manage templates for Standard operating procedures (SOP). The list of available templates displays.
   :::note
   The **UiPath basic template** is available and visible by default.
   :::
3. Select **Upload Template**.
4. Select the **Select file** button.
5. Navigate to the `.docx` file you want to use as a template and select **Open**. An automatic checkd etects the available placeholders.
6. a. If the structure is incorrect, select **Cancel** and add the required placeholders in the template file. b. If the structure is correct, select **Continue.**
7. Enter a descriptive name and, optionally, a short description to indicate a specific usage for the template.
8. Select **Finish**.
9. To set the new template as default template for the whole tenant, select **For whole tenant** in the **Set as templates as default** message box, or select **Cancel** to continue.

You have now uploaded and added the template to the list of templates.

The following table displays the template properties:

| **Property** | **Description** |
| --- | --- |
| Template name | The display name of the template. |
| Visibility | The visibility status of the template.  **Visible**: the template can be selected when exporting a trace.  **Hidden**: the template is not available when exporting a trace.  **Default**: the template is selected by default when exporting a trace. The user can still select other visible templates when exporting a trace. |
| Description | The description to indicate a specific usage of the template. |
| Date added | The date at which the template was uploaded. |
| Author | The name of the user who uploaded the template. |
| Times used | The number of times the template was used for exporting a trace. |
| Actions | Options that enable you to download, or delete a template. |

### Recommended placeholders for PDD templates

We recommend you include the following placeholders in the PDD template to ensure that all the data you documented displays properly in the export file:

* `{title}`
* `{description}`
* `{author}`
* `{email}`
* `{execution_time}`
* `{total_applications_count}`
* `{total_window_titles}`
* `{total_actions_count}`
* `{total_clicks}`
* `{total_keys_pressed}`
* `{total_text_entries}`
* `{total_hotkeys}`
* `{processSummary}`
* `{appsTable}`
  + `{appName}`
* `{appStatsTable}`
  + `{appStatsName}`
  + `{appClicks}`
  + `{appTextEntr}`
  + `{appKeyPress}`
  + `{appDuration}`
* `{actionList}`
  + `{actionListTitle}`
  + `{action}`
    - `{actionStepNumber}`
    - `{actionSubStepNumber}`
    - `{actionTitle}`
    - `{actionDescription}`
    - `{actionImage}`
    - `{action_execution_time}`
    - `{action_type}`

:::note
`{appsTable}` and `{appStatsTable}` should be assigned to Table elements, `{actionList}` should be assigned to a List element.
:::

### Recommended placeholders for SOP templates

We recommend you include the following placeholders in the SOP template to ensure that all the data you documented displays properly in the export file:

* `{title}`
* `{description}`
* `{url}`
* `{author}`
* `{dateCreated}`
* `{total_actions_count}`
* `{execution_time}`
* `{total_applications_count}`
* `{diagram}`
* `{actionsTable}`
  + `{actionStepNumber}`
  + `{actionSubStepNumber}`
  + `{actionTitle}`
  + `{actionDescription}`
  + `{actionImage}`

:::note
`{actionsTable}` should be assigned to Table element.
:::

### Troubleshooting

An error can occur when uploading a template file. The following table describes common error codes:

 <colgroup>
  <col/>
  <col/>
  <col/>
 </colgroup>
 
  
    Error code 
    Description 
    Possible solution 
  
  
    <code>TCW0088</code> 
    The <code>.docx</code> file used as a template for exporting the trace exceeds the maximum allowed file size of 5MB. 
    Reduce the file size of the template file. For example:
      
         Remove unused content or pages. 
         Compress or remove images. 
         Delete hidden or unused styles and content controls. 
      

  
  
    <code>TCW0089</code> 
    The <code>.docx</code> file used as a template for exporting the trace is not in a valid <code>.docx</code> file format either due to corruption or an incorrect file format. 
   
      
         Ensure the file is an actual Word document (e.g., it&rsquo;s not a PDF, TXT, or ZIP file that has been renamed to <code>.docx</code> ) 
         Make sure the file format is correct and that the file was not damaged during upload, download, or by improper editing 
         Verify the file is not a non-standard <code>.docx</code> file created by third-party tools that do not fully conform to Office Open XML standards. 
      

  
  
    <code>TCW0090</code> 
    The <code>.docx</code> file used as a template for exporting the trace has an invalid structure. 
    Ensure that the structure of the Word template is correct and include the recommended placeholders to ensure that all the data you documented is displayed properly in the export file. 
  
 

## Changing template visibility

:::note
You cannot change the visibility of the UiPath basic template and the template that is selected as Default template.
:::

Take the following steps to change template visibilty.

1. Locate the template for which you want to change the visibility.
2. Select the appropriate option in the **Visibility** column.

## Downloading a template

You can download a template and use it as a basis for a new custom template by taking the following steps.

1. Locate the template which you want to download.
2. Select the **Download** option in the Actions column.

The template file downloads to your computer.

## Deleting a template

You can delete a template if you no longer want to use it by taking the following steps.

1. Locate the template for which you want to download and select the **Delete** option in the Actions column.
2. A confirmation message is displayed. Select **OK** to delete the template file and remove it from the list of templates.

## Changing the availability of templates

You can change the availability of templates for Business users and Recording users.

:::note
Tenant Administrators, service-level Task Mining Administrators, and Project Administrators can always choose any template that is set to **Visible**.
:::

The following table describes the possible options for template availability for Business users and Recording users:

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
    Option 
    Description 
  
  
    Use default template only 
    Indicates that Business users and Recording users can only use the template that is set as the Default template. The default template is automatically used for the export and there is no option to choose a template. Use default template only is selected by default. 
  
  
    Allow to select any of visible templates 
    Indicates that Business users and Recording users can choose a template from
      
         all templates that are set to Visible ; 
         the template that is set as the Default template; 
         the UiPath basic template. 
      

  
 

## Default PDD template (localized)

The following table provides localized versions of the default PDD template. You can download a template in any supported language, optionally customize it, and use it as a custom template.

| **Locale** | **Download file** |
| --- | --- |
| en-US | [template.en.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.en.docx) |
| de | [template.de.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.de.docx) |
| es-MX | [template.es-mx.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.es-mx.docx) |
| es-ES | [template.es.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.es.docx) |
| fr | [template.fr.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.fr.docx) |
| ja | [template.ja.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.ja.docx) |
| ko | [template.ko.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.ko.docx) |
| pt-BR | [template.pt-br.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.pt-br.docx) |
| pt | [template.pt.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.pt.docx) |
| ro | [template.ro.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/Template_ro.docx) |
| tr | [template.tr.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.tr.docx) |
| zh-CN | [template.zh-cn.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.zh-cn.docx) |
| zh-TW | [template.zh-tw.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/PDD%20templates/template.zh-tw.docx) |

## Default SOP template (localized)

The following table provides localized versions of the default SOP template. You can download a template in any supported language, optionally customize it, and use it as a custom template.

| **Locale** | **Download file** |
| --- | --- |
| en-US | [template.en.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.en.docx) |
| de | [template.de.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.de.docx) |
| es-MX | [template.es-mx.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.es-mx.docx) |
| es-ES | [template.es.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.es.docx) |
| fr | [template.fr.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.fr.docx) |
| ja | [template.ja.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.ja.docx) |
| ko | [template.ko.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.ko.docx) |
| pt-BR | [template.pt-br.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.pt-br.docx) |
| pt | [template.pt.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.pt.docx) |
| ro | [template.ro.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.ro.docx) |
| tr | [template.tr.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.tr.docx) |
| zh-CN | [template.zh-cn.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.zh-cn.docx) |
| zh-TW | [template.zh-tw.docx](https://documentationpicturerepo.blob.core.windows.net/files/Task_Mining/SOP%20templates/template.zh-tw.docx) |
