# Configuring the Create Record from Template Action

The _Create Record from Template_ action provides the ability to add multiple of the following items:

- _Change Actions_ to new or existing _Change Controls, Quality Event Change Controls,_ or _Change Plans_ from approved _Change Action Templates._
- _Impact Assessments_ to new or existing _Change Controls_, _Quality Event Change Controls_, or _Change Plans_ from approved _Impact Assessment Templates_. 

The _Create Record from Template_ action is available as a user action, entry action, or event action on the lifecycle for _Quality Events_ of the _Change Control_ object type and the _Change Control_ and the _Change Plan_ objects. In this article, these are collectively referred to as _Supported Objects_. The _Change Actions_ and _Impact Assessments_ created from templates are referred to as _Target Records_.

When Vault creates a _Target Record_ from a template, field values in the template are copied to the corresponding field values in the _Target Record_.

## Configuring the Template Object

### Defining Template Data Fields Copied to Target Records

Admins must configure fields on _Template_ objects to capture values that are copied to _Target Records_ created from a template. In order for Vault to copy a field's value from a template to a _Target Record,_ the data field on the _Template_ object must have the same data type and API name, without the trailing namespace, as the corresponding data field on the _Target Record_ object. Only the portion of the field name before the suffix needs to match, for example:

- **_Template_ object field:** `description__v`
- **_Target Record_ object field:** `description__c`

In this example, the value in the `description__v` field on a _Template_ record is copied to the `description__c` field in _Template Records_ created from the _Template_ record.

### Modifying Data Copied from Template Records

_Template Record_ objects include the special _Allow User to Modify?_ field. This field is set to _Yes_ or _No_ when a user creates a _Template_ record. If this field is set to _No_, users cannot modify values in a _Target Record's_ fields populated from the template. Conversely, if this field is set to _Yes_, values in a _Target Record's_ fields that were copied from a template can be updated.

### Limiting Available Templates Based on Supported Object Record Fields

The _Create Record from Template_ action can limit which templates are available for use by matching values in fields on _Template_ records to values in fields on the parent _Supported Object_ record. For example, the _Create Record from Template_ action can be configured so that _Change Action Templates_ whose _Owning Site_ field equals _New York_ are used to create _Change Actions_ for _Change Control_ records whose _Owning Site_ field also equals _New York_. 

Fields on a _Template_ object that are used to limit which _Template_ records are available for use are referred to as _Template Filter Fields_ in this article. In order for the _Create Record from Template_ action to limit which _Template_ records are available for use on a _Supporting Object_ record, Admins must configure the _Template Filter Fields_ using a field name that is the same as a data field on the _Supporting Object_. Only the portion of the field name before the suffix needs to match, for example:

- **_Template_ object's _Template Filter Field_:** `owning_department__v`
- **_Supporting Object_ field:** `owning_department__c`

In this example, if the _Create Record from Template_ action is configured to match _Template_ records to _Supporting Object_ records, the value in the `owning_department__v` field on a _Template_ record must be the same as the value in the `owning_department__c` field on a _Supporting Object_ record to use the template to create a _Target Record_.

### Preparing the Template Object Lifecycles

When a user performs the action, or it is triggered as an entry action or event action, Vault creates _Target Records_ from templates in the lifecycle state associated with the _Approved Template_ lifecycle state type. Ensure that the _Template Object_ lifecycle defines a state for this state type and that your template process brings _Template_ records to that state before the _Create Record from Template_ action is expected to execute.

## Configuring the Supported Object

The _Create Record from Template_ action is available as a user action, entry action, or event action. An Admin must [assign the action to the appropriate _Supported Object_](/en/lr/43127/#assign-actions). When adding it, ensure that the **Available in All Lifecycle States** checkbox is not selected.

### Configuring the Create Record from Template Action

In order to configure the creation of _Target Records_ from templates, Admins must complete the following steps:

1. Navigate to **Admin > Configuration > Object Lifecycles** and click into the desired _Supported Object_ lifecycle.
2. In the _States_ section, click into the lifecycle state in which you want your process to either automatically create _Target Records_, or allow users to create _Target Records_.
3. In the _Entry Actions_ or _User Actions_ section, click **Edit**.
4. Add the _Create Record from Template_ [entry action](/en/lr/59885/) or user action to the lifecycle state.
5. Optional: When you use an entry action, we recommend that you use the [**Perform with conditions**](/en/lr/59885/#conditions) option to prevent unnecessary _Target Record_ creation, defining a condition.
6. Select the _Supported Object_ in the **Associate Record to the Following Object:** drop-down. Generated _Target Records_ will be added to the indicated parent object record.
7. Optional: Select an **Object Type:** for the resulting _Target Records_.
8. Select an object as your **Template Object:**.
9. Optional: Select one or more fields in the **Match on the Following Fields:** drop-down. When the action executes, Vault looks for _Template_ records with the specified fields that have values matching the same fields on the parent _Supported Object_ record. If the action is configured as an entry action or an event action, Vault will create _Target Records_ for each matching template. If the action is configured as a user action, Vault will present the user with a dialog showing all of the matching templates, and allow the user to select one or more templates to create a _Target Record_ for each selected template.
10. Optional: Enter an **Action Label:**. This is only seen by users and only valid for user actions.

## Limitations

* The _Create Record from Template_ action can create up to 300 _Target Records_ at once.
* The _Match on the Following Fields_ option can have up to five (5) matching fields. 
* Fields in the _Match on the Following Fields_ option are restricted to object reference, single-value picklist, and Boolean data types.

## **Permissions**

Users must have the following permissions to execute the _Create Record from Template_ action:

* _Create_ permissions for the _Target Record_ object: _Change Action_ (`change_action__qdm`) object and _Impact Assessment_ (`change_control_impact_assessment__v`) object.
* _Read_ permissions on the _Template_ object: _Change Action Template_ (`change_action_template__v`) object and _Impact Assessment Template_ (`impact_assessment_template__v`) object.
* _Edit_ permissions in Atomic Security for Relationships on states in the _Supported Object_ lifecycle where _Target Records_ are created from templates. For example, ensure that users have _Edit_ permission for the _Change Action_ relationship on the _In Change Plan Definition_ lifecycle state of a _Change Control_.
