# Defining Web Actions

Admins may add web actions to the document or object record **Actions** menu. Web actions can invoke context-sensitive business logic or integrate with external systems and web sites. For example, create a web action to:

  * Generate custom forms for submissions
  * Integrate with third party content authoring tools
  * Publish content to an external site

All web actions must take the form of web links (URLs), which can either open within Vault or in a separate window. URLs can use tokens for document/object fields and additional details like _Session ID_, _Vault Domain_, and _User ID_.

When users select the action, Vault replaces the tokens with the specific document/object's field value or current session information. Like other user actions, an Admin must add the action to specific lifecycle states and can also make the action conditional.

## Using Web Actions

Web actions can be used to extend the functionality of Vault in any number of ways. Typically, it is used to provide necessary functionality that is not a part of the core Vault product such as component authoring, document creation, eSignatures, or many others.  For example:

  * Create a viewable rendition by merging a template and related object data into a new document
  * Open a component authoring solution to create a new draft version of a document
  * Call out to an external service to check grammar and capture those scores in document fields
  * Access reports from object records to review details of related documents and objects

The actions listed above navigate to a URL for an external service that understands the parameters being passed and can take additional actions beyond that. If the session ID is passed, then the service may call back into Vault using the API and take any number of actions, such as querying for more data or creating documents.

## Accessing Web Actions

Web actions are visible and editable from **Admin > Configuration > Web Actions**. You must have a security profile with **Web Actions** permissions.

The **Web Actions** page lists all web actions currently in the system. You can create new web actions by clicking **Create** or edit an existing web action by clicking the web action's name.

## How to Create Web Actions

  1. Click the **Create** button.
  2. Enter a label for the web action. The label appears as a selection in the document or object record **Actions** menu.
  3. Enter a name for the web action. This will default to a field name based on the label, for example, `my_web_action__c`.
  4. Select either _Document_ or _Object_ as the **Type**. This determines whether the action applies to documents or object records.
  5. Select either _Open in New Window_ or _Display Within Vault_ from the **Target** drop-down list. These control where the target URL is displayed when a user selects the web action.
  6. Choose if you want to **Post Session Credentials via Post Message**. We recommend selecting this option as it is more secure than sending session credentials through the URL.
  7. Select one or more fields from the **Fields** panel and either double-click or click the arrow icon to move it to the **URL** panel. The available fields will vary between document and object actions.
  8. Click **Validate**. Vault will let you know if your action is valid.
  9. Click **Save**.

After creating the web action, define it as a **User Action** on the appropriate [document lifecycle state](/en/lr/12339/) or [object lifecycle state](/en/lr/59885/#define-actions) and select **Web Action** as the user action type.

<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>: In some Vaults, certain web actions such as <em>Edit Email</em>, <em>Copy to Another Vault</em>, and <em>Request Web2PDF</em>, are automatically available. To use these, you still must set up User Actions on the document lifecycle state.</p>
    </div>
  </div>
</div>



## How to Edit Web Actions

  1. From the web action list, click an item's **Actions** menu.
  2. Click **Edit**.
  3. Make any necessary changes and click **Save**.

## How to Delete Web Actions

Deleting a web action removes it from your Vault and cannot be undone. You cannot delete a web action that is part of an active workflow.

To delete a web action:

  1. From the web action list, click an item's **Actions** menu.
  2. Click **Delete**.
  3. Click **Continue** in the confirmation dialog to permanently delete the web action.

## Limits for URL Length

Web browsers have various limitations on the maximum number of characters in a URL. Many versions of Internet Explorer limit URLs to 2,083 characters. We recommend that you keep the URL length under that limit. Keep in mind that tokens you include in the URL may render into longer values.
