---
title: "Defining a VaultSpeed Studio Template"
canonical: "https://docs.vaultspeed.com/space/VPD/3013705746/Defining%20a%20VaultSpeed%20Studio%20Template"
format: markdown
---
> Macro (toc)

## Access and Limitations

Before you begin defining a template in VaultSpeed Studio, ensure you have the necessary access:

- **Paid Subscription or Trial Period:** Users with a valid paid subscription or those within a 30-day trial period can access template creation. The trial period begins when the first template is created and allows for the creation of up to 5 templates.
- **Write Access:** Ensure that your account has write access to create or update templates.
- **Trial Limitations:** During the trial period, you are limited to creating a maximum of 5 templates. Plan your template creation carefully to stay within this limit.

If you experience any difficulties accessing VaultSpeed Studio or creating templates during your trial period, please [contact support](https://vaultspeed.atlassian.net/servicedesk/customer/portal/1) with details of your account and subscription status.

## **Step 1: **Define new database schemas (not required):

![image-20221229-065823.png](media://bceb7916-2447-4bcd-8d47-9124cc8ad587)


Click the **‘Signature Schemas’** button to add new database schemas needed for template object generation.

> ℹ️ **Important:** VaultSpeed will not create these schemas. They must be pre-existing in the customer's database. VaultSpeed will use these schemas to add new objects.

![image](media://e9c94fbf-2f53-40b3-b9db-1cc78b2d5e97)

Click the **‘+ Schema’** button to add a new schema.

![image](media://5b444736-0b88-4c94-a7da-e07285fbc614)

![image](media://76708a3f-27d2-4b4e-8ba4-10719cdb4737)

**Trial Period Limitations:**  
Before proceeding with template creation, ensure your account meets the access requirements, especially if you are using the trial period. During the trial, you are limited to creating up to 5 templates, starting when the first template is created.

**Write Access Requirement:**  
Ensure you have the necessary write access to proceed with defining new database schemas and creating templates.

Once done with adding all necessary schemas, go back to the main VaultSpeed studio screen.

## **Step 2: **Define a new template:

Click the **‘+ Template’** button to add a new template:


![image](media://b2aee6c0-afbf-4734-916c-06bed7bd99f3)

- **Name/Description:** Enter the name and description of the template.
- **Signature Object:** Define the alias used within the template for the target object. This will be used within the template to refer to the target object and in other templates to reference the result of this template.
- **Prefix/Suffix:** Use a prefix or suffix to generate names for new objects created from this template.
- **Load Type:** Choose between initial and incremental load types, or select "all" if a single logic applies to both load types or when the object type is a view.
- **Object Type:** Select the object type depending on persistence needs. Options include a table, a view, or a remote view. (Remote view is currently only supported for Denodo).
- **Materialized View**: Choose this option if the template should generate a **Materialized View**, which stores precomputed query results persistently and updates based on a refresh policy. See [Materialized Views in VaultSpeed Studio: Setup for DLT](https://docs.vaultspeed.com/space/VPD/4240375846/Materialized+Views+in+VaultSpeed+Studio:+Setup+for+DLT) for details on setup, ETL configuration, and execution in Databricks.
- **Signature Schema:** Specify the database schema where the target object will be deployed. This can be the standard Business Vault schema or newly defined schemas.
- **Database Type:** (Only available when the remote view is selected as the object type) Currently, only Denodo is supported. Selecting this option will deploy the code generated by the template on Denodo.
- **Folder Name:** (Only available when the remote view is selected as the object type) In Denodo, folders can be used to organize views. This is optional. Example: ‘/BusinessVault’
- **Base Type:** The base type determines which object the template is based on. This affects how many objects are generated, their names, and the dependencies that can be used for building a template/target object.
  See examples: [Template Examples](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3364195117)
- **Upload ETL:** Upload an ETL template file. This action can also be performed afterward. (Format: `.dvt` file)
- **Upload DDL:** Upload a DDL template file. This action can also be performed afterward. (Format: `.dvt` file)

**Trial Period Limitations:**  
During the trial period, you can create up to 5 templates. The trial period begins when the first template is created.

**Write Access Requirement:**  
Ensure you have the necessary write access to create or update templates.

Click the **CREATE** button when you are ready to create your first template definition.

![image](media://3a85a3a1-f126-45ab-b147-f0d4a38429f3)

As shown in the screenshot above, a template should appear in the overview once created.

A few things that can be further defined:

- **On the Template Level:** Target Definition and Dependencies
- **On Release Level:** Signature attributes and Signature objects

## **Step 3: **Configure extra signature attributes (not required)

![image](media://6ddd818d-ff28-4af6-bbed-aeac1a752111)


By default, a specific attribute has a signature attribute. This can be primary_key, foreign_key, business_key, etc. Sometimes, you want to group attributes that are a subset of existing or across different signature attributes.

Currently, this is possible for Data Vault objects and Business Views.

**Management:**  
For example, to add a calculation with all amount-related fields in different satellites, a new “AMOUNT” column type can be defined here.

![image](media://ff44e053-7bed-4c9f-83d1-81a899d5d817)

![image](media://ca74ba70-01a4-43ed-b969-8ea85d140293)

![image](media://44a89068-91b9-4183-b8b2-cf104a195775)

**Assignment:**

![image](media://66737caf-9e53-42c4-8f05-44800536a232)


The user can assign the signature attributes created in the management tab on this screen. After filtering records using the different filters (combined with the OR - AND setting), signature attributes can be applied to all records after filtering by choosing the Signature Attribute from the drop list and clicking Set.

![image](media://eccd4650-2544-4339-a2a6-e9e9031480e1)

If the assignment should be applied to one attribute, open up the object and edit one specific object.  


![image](media://eda8d574-1f45-4ca9-a10c-b69ae5a55a87)

and click

![image](media://b43e3a5c-0b39-4de0-86b1-e6f9d98a195a)

**Write Access Requirement:**  
Ensure you have the necessary write access to configure extra signature attributes.

After assigning the signature attributes, you can return to the main screen of the VaultSpeed Studio by clicking ‘<- back’ in the breadcrumbs.

## **Step 4: **Configure extra signature objects (not required)

![image](media://1475af0a-bc34-444c-b716-270a137fff4e)

By default, a specific object has a signature object. This can be hub, sat, nhl, etc. Sometimes, you want to group objects which are a subset of existing signature objects or across different signature objects.

**Management:**  
For example, a new “AMOUNT_OBJECTS” column type can be defined to add a signature object for a subset of satellites containing amount-related fields.

![image](media://d4b98d3a-6202-4f4f-a5b7-43b78782a7c5)

![image](media://39be5402-19f6-4450-98e9-9f5b373de63e)


![image](media://84b9e85c-c2b8-4b53-ab39-bd45a60ccc30)


**Assignment:**

![image](media://fe5aa878-cf57-46c5-bb49-f18ad328319b)

The user can assign the signature objects created in the management tab on this screen.

Filters can be applied to the object name, object type, signature object, or signature attributes (to add a signature object only on objects that contain a specific signature attribute).

After filtering records using the different filters (combined with OR - AND setting), signature objects can be applied to all records after filtering by choosing the signature object from the drop list and clicking Set.

![image](media://934be6b2-f0d1-4d22-8087-62c205dd54e7)


If the assignment should be applied to one object, edit one specific object.

![image](media://a71b1ee9-4882-4c94-983e-533c0e0c422b)


and click

![image](media://b43e3a5c-0b39-4de0-86b1-e6f9d98a195a)

**Write Access Requirement:**  
Ensure you have the necessary write access to configure extra signature objects.

After assigning the signature objects, you can return to the main screen of the VaultSpeed Studio by clicking ‘<- back’ in the breadcrumbs.

## **Step 5: **Configure template object dependencies

Continuing with the template setup, define which objects the template should generate a mapping for in the dependencies screen.

![image](media://8fc17307-65b2-4c2d-82b2-08dac8f633ab)


![image](media://a46e93ee-4f32-4408-91bb-e100b0c2efaa)

Click the down arrow next to an object to view the dependent objects and their table types, which determine how they can be referenced in the templates.

Link and unlink objects by clicking the checkbox next to one or more objects to select them, and then click on the **Link** or **Unlink** buttons.

![image](media://5a6f644d-507f-4ca2-a423-587bf79e8b23)

**Write Access Requirement:**  
Ensure you have the necessary write access to configure template object dependencies.

Once the linking/unlinking of the objects is complete, you can upload the template. Refer to the [examples ](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3038937106)and [language specification](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3011182712) for guidance on building a template.

## **Step 6: **Configure the target attribute definition.

![image](media://34d9089a-c7f7-4beb-aa70-2026d7db9d06)

There is a separate window for configuring target definitions, as shown below.

![image](media://d31236d7-2a52-4ee3-9732-02d72e6322cc)

### 6.1 Existing Attributes

Existing attributes allow you to include attributes from the DV objects into your new object created by the template. In this example, we want to create a computed Satellite. This object needs to include all attributes of the satellite plus an extra attribute. To add **all** the satellite attributes, choose the “SAT” option from the **‘+ All from Signature Object’** button:

![image](media://92377636-4a84-4bbd-b3ea-2bbca61c5f6d)

 

![image](media://692369be-51ed-4302-9e89-da168740a5c5)


> 📝 **Note**: All attribute types can be selected here, including default and newly created signature attributes.

This only determines which attributes are stored in the target object. All other attributes can still be used in the template for intermediate logic.

> ℹ️ **Write Access Requirement:**  
> ℹ️ Ensure you have the necessary write access to configure target attribute definitions.

### 6.2 New attributes

**Available fields:**

![image](media://c276905d-1ef3-4a2a-940f-fb178248ff46)

- **Unique:** Use this toggle button to define if the new target attribute is based upon another attribute (non-unique), not directly based upon another attribute (unique), or based on multiple attributes (unique). If the base column type has multiple attributes, you will have multiple target attributes (non-unique).
- **Name:** If the attribute is unique, a name is required.
- **Prefix/Suffix:** A prefix or suffix is needed if the attribute is non-unique and based on an existing attribute.
- **Signature Object:** Determines which signature attributes are shown in the next dropdown.
- **Signature Attribute:** Determines which signature attribute the new attribute should be based on. For a unique attribute, this can be empty. When chosen, a signature can provide the new target attribute with its data type and length/scale. This should be filled in for a non-unique attribute since it determines the set of target attributes that will be generated.
- **Data Type:** The data type of the target attribute. This is optional for unique attributes with a signature defined. If it is left empty, the data type of the attributes with the selected signature will be used as the data type of the new attribute. This is only possible for signatures containing multiple physical attributes if all the attributes have the same data type.
- **Data Length:** If the attribute is unique, the data length can be a fixed number or an aggregation (if a signature is selected), e.g., 4000 or max(x). In the case of max(x), it will take the maximum of all attributes with the chosen signature. If it is non-unique, it can be any function of the original length, e.g., X (this will keep the original length), but you can also have 2*X (Original length multiplied by two) or X + 2 (original length + 2).
- **Data Scale:** If the attribute is unique, the data scale can be a fixed number or an aggregation (if a signature is selected), e.g., 4000 or max(x). In the case of max(x), it will take the maximum of all attributes with the chosen signature. If it is non-unique, it can be any function with the original scale, e.g., X (this will keep the original scale), but you can also have 2*X (Original scale multiplied by two) or X + 2 (original scale + 2).

#### 6.2.1 Adding a non-unique attribute:

![image](media://1c230527-bb9d-4e28-9286-ba4ea8a93342)

If there should be multiple target attributes, one for each attribute with the selected signature attribute (e.g., getting a new target attribute for every primary key attribute), the switch of the unique toggle button should stay disabled. In that case, a prefix or a suffix should be filled in as it will be concatenated to the name of the physical attributes with the selected signature.

For example, for every descriptive attribute `(OTHER_ATTR)`, a new attribute with the suffix “`_TRIM`” will be created. If there is an attribute `NAME`, it will result in a `NAME_TRIM` attribute in the target.

This attribute can be referenced in the templates with the signature `OTHER_ATTR_TRIM`.


#### 6.2.2 Adding a unique attribute:

![image](media://df8394fe-a52c-4135-9318-bbd6258c2032)

If the target attribute is a new solitary attribute (e.g., a concatenation of one or more “`OTHER_ATTR`” signatures or a new technical field like a timestamp), then the unique toggle switch should be on/enabled.

For instance, to concatenate all descriptive fields or create a hash, a single target attribute can be created, linked to the `OTHER_ATTRIBUTE'`s. In this case, a name field is expected instead of a prefix/suffix, for example, `NEW_HASH`. This name will be used in the templates as the signature and will also become the name of the physical attribute in the target table.

> ℹ️ **Important remark**: if a temporary attribute is needed in the template that does not need to be stored in the target table, then an `Artifact`can be used in the template without defining it first.

## **Step 7: **Build a template(s):

We advise building the templates in Visual Studio Code. Our plugin for the VaultSpeed template language can be downloaded from the main VaultSpeed studio screen. A guide to installing the plugin can be found here: [https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3038117893](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3038117893) 

![image](media://cf0d493a-d092-4228-8fe6-58f89c56dc90)

**Write Access Requirement:**  
Ensure you have the necessary write access to build and modify templates in VaultSpeed Studio.

To help you get started with building templates, here are a few examples to get started:

[https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3038937106](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3038937106)   


## **Step 8: **Upload the template(s):

If you haven’t already uploaded your templates in Step 2, proceed with the following steps to upload them:

Click **View** below ETL Template to access the template editor. The editor allows you to test the template and make minor corrections. 

> 📝 **Note **that this is a basic editor, not intended for full development; improvements will be made in future releases. You can also compare your current version with previously saved versions.

**Write Access Requirement:**  
Ensure you have the necessary write access to upload and save templates.

![image](media://ffd28619-83e2-4238-8668-061007c7bb87)

Click **Upload** and choose your template (.dvt) file. 

![image](media://6d8c031d-daca-433c-a7a8-4898e3c09503)

Once selected, click **Upload** again, and then click **Save**.

![image](media://7ad5522c-6170-4d4a-89fe-ee4486049982)

  
Upon saving a template, a syntax test will automatically run. This test will alert you if there are any issues according to the language rules, providing line number references for any errors detected.

![image](media://b5c26cb9-9bc0-4914-9adb-315e4cd0c094)

These warnings will also be visible in the template overview.

![image](media://3a5268f8-d1f5-4980-9a13-46ac6f6cde8b)

![image](media://43b9f72e-2dcd-4f27-b96a-1fee85d5f3c0)

If your test passed, a syntax check alone is insufficient to ensure the template behaves as expected. Use the **Generate Preview** button to view the actual generation behavior. Select a language and one of the dependent objects, then click **Generate** to initiate a quick ETL Generation task, which generates code for your template based on the selected object.

![image](media://4ee64a7d-496f-499a-a1f4-8b7bc887f253)

After generation is complete, you can view the generated code in the **Preview** tab.

![image](media://a5945ac0-45ac-41cc-b5b1-b466cd9c1576)

Once all your templates are satisfactory, you can lock your Business Vault and generate your code. The ETL and DDL for your custom templates will be generated alongside other Business Vault objects during the ETL generation. Note that the DDL for custom templates is included in the ETL generation rather than a separate DDL generation.

## Extra: Denodo

VaultSpeed Studio allows for the creation of Denodo templates. Before building templates, verify the following parameters that impact Denodo code generation:

![image](media://bc2f294a-3bce-436c-970c-48bc00d9669b)

**DENODO_DATASOURCE_NAME**

- Specify the name of the source connection in Denodo. For example, azure_postgres.
  

**GENERATE_DENODO_WRAPPERS_AND_BASE_VIEWS**

- Automatic wrappers and base views are generated for all Data Vault and Business Vault objects in the target Data Warehouse. This generates an extra `.vql` script executed on auto-deploy. The script gathers all objects available in the Data Vault and Business Vault schema and generates the script for the wrapper and base views, which are then executed in a second step.
  

In VaultSpeed Studio, during template creation, choose **Object Type: REMOTE VIEW** and **Database Type: DENODO**.

![image](media://e0c30873-2f54-42ac-ab95-16d0ba2bc284)


After selecting the database type, a folder can be added instead of a schema because Denodo uses folders instead of schemas. Always start with `/`.

Once the template is configured in the studio, you can lock the Business Vault.  


**Write Access Requirement:**  
Ensure you have the necessary write access to create and configure Denodo templates.

To generate code, navigate to the DDL and ETL generation. Only the ETL generation type of the Data Vault will appear in the ETL generation type. VaultSpeed will generate separate zips for the target Data Warehouse and Denodo codes (wrappers and base views + VaultSpeed Studio views), enabling auto-deployment to Denodo.

![image](media://75079e20-ce5a-4274-bf95-b0893b1ebdb4)


For auto-deployment, create a new DENODO database link referring to the connection defined in the agent.

![image](media://a02e371e-dbbe-4cac-a561-b756df359ff4)

Example in the agent connections.properties file:

![image](media://0d228fad-0ac1-4cbf-b17d-a8ce47802ba7)