# Defining Event Actions

Event actions are configurable actions that take place automatically when a user creates a document from a file upload, creates a new draft of an existing document, creates a copy of an existing document, or creates a new object record. For example, an event action could set the _Review Due Date_ to 15 days in the future when users create a new document.

Event actions are defined much like entry actions. They:

* Exist within a specific lifecycle; they are not specific to a single lifecycle state, but to the lifecycle generally
* May be conditional based on the document or object record's field values
* Execute using "System User," meaning that the user who initiates the triggering action does not need specific permissions for the event action

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: Lookup fields update asynchronously. For this reason, we do not recommend using them in time-based processes such as lifecycle entry actions or entry criteria.</p>
    </div>
  </div>
</div>



## Accessing Event Action Administration {#event-action-administration}

You can configure both document and object record event actions from within the related lifecycle:

* For documents, navigate to **Admin > Configuration > Document Lifecycles > [Lifecycle] > Event Actions**.
* For object records, navigate to **Admin > Configuration > Object Lifecycles > [Lifecycle] > Event Actions**.

## Document Action Types

Event actions for documents support:

Update field
: These actions automatically update one or more fields on the document based on the configured value or formula. The action can update _Text_, _Number_, _Picklist_, _Yes/No_, _Date_, and _DateTime_ field types. See <a href="/en/gr/42857/">Creating Formulas in Vault</a>
 for details on building formulas.

Set Rendition Profile
: This action selects a specific <a href="/en/gr/153330/">_Rendition Profile_</a>
 based on your configured criteria.

## Order of Operations for Documents

Vault triggers most event actions at the end of the document creation process. Because this occurs after field defaulting rules have been applied, the event actions may be conditional based on fields set by the user or based on fields set with defaulting rules.

Vault applies _Update field_ actions for _Create Document_ and _Create Copy_ event actions before a document is created. This allows documents to be created with empty required fields if an event action populates the required fields.  

## How to Create Event Actions for Documents {#create-event-actions}

To add a new event action rule:

  1. From the **Event Actions** tab, click into a specific event.
  2. On the event configuration page, click **Edit**.
  3. Click **Create Event Action**.
  4. Optional: Add conditions to the event action rule by selecting **All conditions are met** or **Formula evaluates to True**.
  5. Under **perform actions**, select the type of action and any other needed values. The other values will depend on the action configuration.
  6. Optional: Create more actions within the same rule by clicking **Add action**. If the rule is conditional, these actions share the same conditions.
  7. Click **Save**. The configured event actions become active immediately.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: Vault does not execute Event Actions for documents uploaded via Vault API or Vault Loader in Document Migration Mode.</p>
    </div>
  </div>
</div>



## Object Record Action Types {#object-record-action-types}

Event Actions for object records support:

Update Field
: These actions automatically update one or more fields on the object record based on the configured value or formula. The action can update _Text_, _Number_, _Picklist_, _Yes/No_, _Date_, and _DateTime_ field types. See <a href="/en/gr/42857/">Creating Formulas in Vault</a>
 for details on building formulas.

Start Workflow
: These actions automatically start the specified workflow for the object record. Only workflows configured for auto-start are available.

## Order of Operations for Object Records

Vault triggers event actions during the object record creation process as follows:

* **Update Field** object record actions occur before field defaulting. If the event action sets a field value, Vault ignores any configured defaults for that field in order to not overwrite the value. Learn more about <a href="/en/gr/42778/#order-of-operations">order of operations for object field defaults</a>
.
* **Start Workflow** actions occur after triggers, field defaulting, and _Update Field_ object record actions.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: If these event actions fail for any reason, object record creation will not complete.</p>
    </div>
  </div>
</div>



## How to Create Event Actions for Object Records {#object-event-actions}

To add a new event action rule:

  1. From the **Event Actions** section, click into the **Create Record** event. In 19R1, event actions will only support this event for object records.
  2. On the event configuration page, click **Edit**.
  3. Click **Create Event Action**.
  4. Optional: Add conditions to the event action rule by selecting **All conditions are met** or **Formula evaluates to True**. If you select **Formula evaluates to True**, use a formula that returns a boolean (true/false) expression to define the condition.
  5. Under **perform actions**, select the type of action and any other needed values. The other values will depend on the action configuration.
  6. Optional: Create more actions within the same rule by clicking **Add action**. If the rule is conditional, these actions share the same conditions.
  7. Click **Save**. The configured event actions become active immediately.

## How to Define Conditions {#conditions}

Certain event actions are only needed when the document or object record meets a set of conditions. For example, you can configure an action that updates the document field _Approval Due Date_ only if the _Approval Required_ field was set to _Yes_. To do this, you'd define a condition based on the _Approval Required_ field.

To define conditions, select **All Conditions are met**, and then a document field or object field, operator, and value. Some system fields are not available. You can also select **Formula evaluates to True** to use a formula expression that returns a boolean (true/false) expression to define the condition. The event action executes only if the formula returns a true expression. If needed, you can define multiple conditions by clicking **Add condition**.

A document or object record must meet all of the conditions defined within a rule for Vault to perform the event actions. If a condition uses a field that does not apply to the document or object record, Vault evaluates that condition as "false." When the condition evaluates as false, the event (document creation, object record creation, etc.) continues, but the action does not take place.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: Document IDs are not supported in formula-based conditions for <em>Create Document</em> event actions. In addition, document numbers are not supported in formula expressions or field conditions in document lifecycle event actions.</p>
    </div>
  </div>
</div>



### About Referencing Missing Records in Criteria & Actions {#referencing-missing-records}

When you clone a lifecycle configuration during <a href="/en/gr/32913/">Vault provisioning</a>
, references to specific object records in entry criteria or conditions may become invalid if those records do not exist in the new environment. If this occurs, references to missing object records are shown as empty in lifecycle configuration fields.

While Vault allows you to save configurations even with these missing records, we recommend resolving these missing references by recreating the records with the same _ID_ values using <a href="/en/gr/26597/">Vault Loader</a>
 or via the Vault API if you want to use these conditions in the new environment. If you only want to update another configuration and take it back to the source environment, you can leave the missing references as is.

## How to Edit or Delete Event Actions

To make changes to event action rules, click **Edit**. If you need to delete an entire rule, a condition within a rule, or an action within a rule, click the **X** icon. When your changes are complete, click **Save**.

## Limits

The following limits apply to defining event actions:

* For each lifecycle and event (for example, _Create Document_), you can define up to 25 event action rules. Within a rule, you can specify up to ten (10) event actions. If a rule is conditional, it can have up to five (5) conditions.
* Document IDs are not supported in formula-based conditions for _Create Document_ event actions.
* Document numbers are not supported in formula expressions or field conditions in document lifecycle event actions.
* For Object Lifecycle Event Actions, conditions are only evaluated for fields if the user triggering the event action on the record has permission to edit the field(s).

## Related Permissions

To define document event actions, you must have a security profile with the _Admin: Document Lifecycles_ permissions.

To define object record event actions, you must have a security profile with the _Admin: Object Lifecycles_ permissions.
