# Actions

Actions are ways of extending Form.io to perform tasks when there is form submission activity. These actions can be triggered when certain things occur like a form submission, submission update or deletion, and so on. There can be multiple actions on any given form providing the ability to initiate different business workflows. For example, you can authenticate a user account against your User Resource, send an email with data details, or fire off a webhook to send the data to an external system.

## Adding an Action <a href="#adding-an-action" id="adding-an-action"></a>

To add an action, go to the Actions tab of a form. Select the type of action from the dropdown then click the **Add Action** button. You can add multiple actions to run on each form submission.

Click the  **Edit** icon to open the action's configuration settings. Click the red **Trash Can** icon to delete the action from the Form or Resource.

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2F1wr5CzGJuaA71gwzwcDX%2Faddaction.jpg?alt=media&#x26;token=5add24f5-2691-4b93-a481-8032e952cc75" alt=""><figcaption></figcaption></figure>

## Common Settings

All actions perform different functions, however, many of the actions share some common settings that can be configured by the user.&#x20;

**Title:** The name or label of the action. Modify the Title to provide more of a description of the action's specific purpose or function. The Title will display on the Action overview page.

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FQosp6xyhjvN7CLaAQ9pG%2Fimage.png?alt=media&#x26;token=7718da32-bafe-4b09-9bee-5f0f1213f3c0" alt=""><figcaption></figcaption></figure>

**Handler:** The handler determines whether the action will be sent **Before** or **After** the MongoDB query mechanism (that is, before or after your submission is saved to the database). If you select both, it will run twice, once before your submission is saved and once after.

**Method:** The Method determines when to run this action on a form. Select which system events will trigger this action:&#x20;

* **Create** - Action will fire when a new submission is created
* **Read** - Action will fire when a submission is Read (or viewed)
* **Update** - Action will fire when a submission is updated
* **Delete** - Action will fire when a submission is deleted
* **Index** - Action will fire when indexing (or searching) a submission within the Database&#x20;

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FdDylCwrenGTWXRUOyVTT%2Fhandlermethod.jpg?alt=media&#x26;token=11b1a574-e1dd-405c-b470-55a379f321e0" alt=""><figcaption></figcaption></figure>

**Action Conditionals:** Use the Simple conditional dropdown workflow or write your own Javascript to execute the action only when certain conditions have been met on the Form or Resource. The Conditional system is the same system used to facilitate field conditions.

[**Read more about Conditions here**](https://help.form.io/form-building/broken-reference)

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FTm8BIPkhqmXEsXyd30GJ%2Fconditions.jpg?alt=media&#x26;token=71c29751-d3cc-402d-a2ab-0e8ec8164dd4" alt=""><figcaption></figcaption></figure>

## Action Logs&#x20;

{% hint style="info" %}
Action Logs are part of the [Security Module](https://help.form.io/form-building/broken-reference) only. Please contact <sales@form.io> for more information on adding the Security Module to your current License Subscription.
{% endhint %}

Action Logs will display a log of triggered actions and relevant contextual information about those executions. This feature must first be enabled on a per form basis before the Action Logs are documented. Click the 3 dotted settings button, Action Logs, then select Enabled from the setting dropdown.

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FkjBlzduwe7oOAV4dL6EB%2Factionlogs.jpg?alt=media&#x26;token=86ed1161-e820-4958-a83b-35f9125fb058" alt=""><figcaption></figcaption></figure>

Once enabled, any executed action will be documented within the Logs. Each log provides the user with relavent information that can be searched and filtered like the Date/Time, Action type, or the Action status, which can be particularly helpful when finding a failed action.

* **Date/Time** - Indicates when the log was recorded
* **Submission** - Provides the Submission ID the Action is associated with.&#x20;
* **Action** - Details the type of action
* **Handler** - Determines if the action was executed before or after the submission
* **Method** - What Submission CRUD operation the action was executed

{% hint style="warning" %}
**Action Logs will be automatically deleted after 30 days.**
{% endhint %}

Clicking a line item in the Log will give you detailed information about the Action's execution process. This can be very helpful when tracking down any issues that might be occurring with the Action.&#x20;

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2Fw7ETmNjuTM47uXLyERQL%2Flineitem.jpg?alt=media&#x26;token=33300d8c-af4f-4b53-956c-32047a870e5a" alt=""><figcaption></figcaption></figure>

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Email</strong></td><td>Fire off an email when submission activity occurs on a form</td><td></td><td><a href="actions/email-actions">email-actions</a></td></tr><tr><td><strong>Login</strong></td><td>Verifies user credentials against a Resource when authenticating into an application </td><td></td><td><a href="actions/login-actions">login-actions</a></td></tr><tr><td><strong>Role Assignment</strong></td><td>Add, modify, or remove a role from a user when certain submission activity occurs</td><td></td><td><a href="actions/role-assignment-actions">role-assignment-actions</a></td></tr><tr><td><strong>Save Submission</strong></td><td>Map the form field data to other Resources within a project.</td><td></td><td><a href="actions/save-submission-actions">save-submission-actions</a></td></tr><tr><td><strong>Webhook</strong></td><td>Use a webhook to integrate your form submission into other applications or databases</td><td></td><td><a href="actions/webhook-actions">webhook-actions</a></td></tr><tr><td><strong>OAuth</strong></td><td>Authenticate users using a OAuth provider</td><td></td><td><a href="actions/oauth-actions">oauth-actions</a></td></tr><tr><td><strong>LDAP Login</strong></td><td>Authenticate users against a LDAP service provider.</td><td></td><td><a href="actions/ldap-login-actions">ldap-login-actions</a></td></tr><tr><td><strong>Google Sheets</strong></td><td>Map form data to a Google Sheet spreadsheet</td><td></td><td><a href="actions/google-sheets-actions">google-sheets-actions</a></td></tr><tr><td><strong>SQL Connector</strong></td><td>Deprecated</td><td></td><td><a href="actions/sql-connector-actions">sql-connector-actions</a></td></tr><tr><td><strong>Group Assignment</strong></td><td>Facilitates group based permissions assigned to users within the group</td><td></td><td><a href="actions/group-assignment-actions">group-assignment-actions</a></td></tr><tr><td><strong>eSign</strong></td><td>eSignature provider integration to provide digital signatures</td><td></td><td><a href="#esign">#esign</a></td></tr><tr><td>2<strong>FA &#x26; Recovery</strong></td><td>Authenticate or recover your application account using using a one-time code </td><td></td><td><a href="actions/two-factor-auth-and-recovery-actions">two-factor-auth-and-recovery-actions</a></td></tr></tbody></table>
