# Application Templates

> What an application template holds, the objects it can contain, and what export, import, install, uninstall and delete do.

Source: https://proxus.io/docs/organize/app-templates

An application template is a package of configured objects (for example a device profile, its devices, the rules
that watch them and a dashboard) that can be moved to another hub as one file and installed there. Templates are in
**Organize > Application Templates**; the screen's title is **App Templates**.

*Screenshot: The App Templates list with one template selected and the New, Export Template, Import Template, Install and Uninstall actions in the toolbar*

1. **New** creates a template.
2. **Export Template** downloads the selected template as a `.json` file.
3. **Import Template** reads a template file and adds it to the list, not installed.
4. **Install** creates the template's objects in this hub.
5. **Uninstall** removes the objects that installing created.

## What a template holds

| Field | Meaning |
| --- | --- |
| **Id** | A short code given when the template is created. It is part of the names of installed objects. |
| **Name**, **Description**, **Developer**, **Usage Instructions**, **Image** | What the template is, who made it and how to use it. |
| **Date Created** | When the template was created. |
| **Installed**, **Installation Date**, **Uninstallation Date** | Whether its objects are in this hub, and when they were added or removed. |
| **Objects** | The objects in the template, each with its type and caption. |

An object is stored in the template as a copy of its settings at the moment it was added. Changing the original
object later does not change the template; remove the object from the template and add it again to take the change.

### Object types

When you add an object, **Type** lists the kinds of object a template can hold: **Dashboard**, **Device**,
**Device profile**, **Function**, **Notification channel**, **Outbound target**, **Report**, **Role**, **Rule** and
**User**. The **Objects** list shows each object's type next to its caption.

When you add a device, its device profile (with its tags) is added with it, because a device does not work
without it. A device's edge gateway and outbound targets are not copied into the template: they belong to the hub
where the template is installed and must exist there.

## Install

**Install** asks **Install this template?** and then creates a new copy of every object in the template. The
copies are linked to each other the same way as the originals. The originals in the template are not used.

- What a copy points at but the template does not hold (edge gateways, rule actions, outbound targets) is not
  copied. The copy is linked to the same objects in this hub, if they exist here.
- A copied device gets its own device token.
- A copied object's name gets the template's name and **Id** added, with spaces replaced by underscores. For
  example, the rule `DOCS_Temperature above 60 °C` from the template `DOCS_Temperature alarm` with Id `1a2b3c4d`
  becomes `DOCS_Temperature_above_60_°C_DOCS_Temperature_alarm_1a2b3c4d`. This keeps the copies apart from
  objects that already exist.
- Functions are renamed the same way and deployed.
- Copies keep their settings, including whether they are active. An inactive rule is installed inactive.
- Before installing, Proxus checks the license. If the template would create more objects of a kind than the license
  allows, nothing is installed and the message says by how many it is over.

An installed template cannot be edited; its fields are read-only.

## Uninstall and delete

**Uninstall** asks **Uninstall this template?** and deletes the copies that installing created. Functions are
undeployed first. The template stays in the list with all its objects, ready to be installed again.

> **Warning:**
Uninstalling deletes the installed objects, including any changes you made to them after installing. Export or copy anything you want to keep before you uninstall.

**Delete** asks **Deleting this template also uninstalls it. Continue?** and removes the template. If it was
installed, its objects are removed as described above.

## What's next

- [Create and export a template](https://proxus.io/docs/organize/create-an-app-template)
- [Import and install a template](https://proxus.io/docs/organize/install-an-app-template)
