> For the complete documentation index, see [llms.txt](https://docs.work-relay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.work-relay.com/forms/form-building/form-action.md).

# Form action

## Adding form actions

Open the "Tools" menu and click "Form Actions".

![](/files/6d2f816624b34e857f5436b198032523383010af)

Click the "Add Action" button in the "Form Actions" popup:

![](/files/281c70ed316ad1a3d2344798099f404f487ec39b)

Populate the Title, Description (optional), and Type fields.\
If the Form Action has [conditions](/forms/basics/working-with-conditions.md) that must be matched in order for it to execute, check the "Has Conditions" checkbox.

![](/files/d52f373b61e8e6fe3e299508072690fa029c5652)

You can create form actions of following types:

## Update Value action type

Select "Update Value" as the **Type** and click the "**Add**" button.

![](/files/e949b6307718ae29398a9d9daa41ed4b9f8f107d)

'Update Value' actions perform updates on the following **Target** entities:

* Form - specific Form elements that can be updated
* Variables - Form Variables
* Context Object - the context object of the Form (e.g. "Case")

The **Source** for the update can be set to one of the following types:

* Parameters - parameters passed to the action
* Form - form element values
* Variables - form variables
* Context - the context object of the form
* Static - a static value provided by user

![](/files/961aed6812e6fcb7d35fff17a05527c19bacd3df)

{% hint style="warning" %}
When you use "Update Value" action and update Context Object field (as on the screenshot above), the updates you make to these fields will not be included in Save unless they are displayed on the form. Use [extended fields](https://sites.gitbook.com/preview/site_4yKrA/forms/basics/working-with-form-settings#save) under Save functionality to include fields that are not present on the form (e.g. not added to the layout or hidden via condition styles) into Save operation.
{% endhint %}

## Global Action and Global Action Group action types

"Global Action"/"Global Action Group" actions trigger global action/group execution and allow you to use the results of that execution in Form config.

Select the desired **Type** from the picklist and populate the remaining fields:

**Name** - click the Settings ("gear") icon next to it and select an action/group. Click the **Arrow** icon to open the selected action in a new tab (if no action/group is selected yet, the icon will be "+" and will open the new action/group creation form).

![](/files/0d2b8cd9bcba8355083c221e5e96b29b6014fe64)

**Source** (optional) is the ID of a record that is used as a data source for the global action. You can set it directly or configure it with the merge field constructor ("gear" icon next to it).

![](/files/af84edb5e243de3aed5dda77e336fecef29b9c52)

Set **Variables** if you need to pass parameters to the global action. Follow the sequence of steps below to add and set variables in the Variables popup:

![](/files/6ec30322dad5b2d4223f563db5d1e401e7da0524)

**Result Handlers** are form actions that are executed once global action execution is done. Click the gear icon to select and configure them (they should be configured on the Form first).

You can pass parameters to Result Handler actions, if necessary. Click the Settings ("gear") icon for setup. Follow the sequence of steps to set the parameters in the popup.

![](/files/2922549bc676e296b26223844b8d9584d9f8c761)

{% hint style="info" %}
Output context on the Parameters setup screen represents variables that were set during Global Action execution. Config below uses the newCaseId variable that was created by Global Action.
{% endhint %}

![](/files/8e9b8288e1baacf55bf8821f4de35b7101f15f1b)

"Global Action Group" form action setup is same as "Global Action".\
Check the Disable Spinner checkbox (14) to disable the spinner that is shown by default while the action is executing.

For more information about usage of Global Actions and Global Action Groups please refer to the following documentation: [Actions/Action Groups](/automations/global-actions-and-action-groups/basics.md)

## Refresh action type

'Refresh' actions perform a refresh of one of the following form elements:

* Form itself
* Lists
* Related Lists
* Lookups
* Nested Forms
* Current page (available starting release 8.7)

Select the "Refresh" action type and select the target element of the form to be refreshed:

![](/files/51cd2a81861d2dbcbd30d2ed7d60c11651b7ca8a)

{% hint style="info" %}
Current page option will reload whole browser page.
{% endhint %}

The Refresh action makes lookup and list components re-evaluate the conditions by which records are shown.

E.g., lookup conditions contain a variable that is used to filter records in this lookup. If this variable is updated by the user (as a result of some manipulations on the current form), a Refresh action must be triggered to force the Lookup field to show records matching the new variable value.

## Navigate action type

The Navigate action type allows the user to navigate to one of the following resources:

* URL
* Visualforce Page
* Record
* Form
* Lightning Component
* Return Back

### Navigate to URL

Configure the destination "URL".\
Enter URL into proper field.\
If desired, check the checkbox to **Open in New Window**.\
If desired, configure the desired **Parameters** to pass.

![](/files/f9a1bffbbb3f2e7f55a445a67824e1937afaaab9)

### Navigate to Visualforce page

Select the destination "Visualforce page".\
Select a page in **Name** field.\
If desired, check the proper checkbox to **Open in New Window**.\
If desired, configure the desired **Parameters** to pass.

![](/files/f6561e65a30d0680a0a40bcb97b362e3cce04409)

### Navigate to record

Enter the record **ID** of the destination record or configure it with the merge field picker (25)

![](/files/b4bda120f899ae8c5f88b520c67a4048118403bd)

### Navigate to form

Select the destination "Form".\
Select the desired Form **Mode**.\
If desired, configure the desired **Parameters** to pass.

![](/files/248f2858f0c2858f82ff3e1d618947101d72a749)

### Navigate to Lightning component

Select the desired destination: set **Navigate to** to "Lightning Component".\
If desired, check the box to Open the Lightning Component in a **popup**.\
If desired, configure the desired **Parameters** to pass.

![](/files/e46c8d4a8f60f467a369209ee277c74b56c939da)

### Return back

Select "**Return Back**".\
Set the desired number of\*\* browser history steps\*\* to go back.

{% hint style="info" %}
This option executes the browser `history.back()` function. User should provide the 'Browser history steps' value to define how many redirects should be executed. By default 'Browser history back' equals 1. 'Return Back' option also allows the user to go to one of the previous Forms when working with chained Forms.
{% endhint %}

![](/files/74668715cee1570657c4d608b60305cc327cf56a)

## Form API action type

"Form API" actions execute one of the following methods:

* **Save** - saves context object
* **Reset** - resets the original values of all fields in a form
* **Clear** - removes values from all form inputs
* **Show Notification** - displays the defined notification to user
* **Validate** - validates form inputs and shows error(s) if some of them are blank
* **Print Form** - creates a PDF version of the Form, which can be printed
* **Fire Event** - fires a Lightning event. This can be an aura application event or force event.
* **Execute Form Actions** - runs action (or group of actions) on the current form/nested form/parent form
* **Close** - closes current form
* **Calculate** - performs calculations/executes formula on the form
* **Update Process Instance Variables** - updates variables in a specified Process Instance
* **Execute Workflow Line Action** - allows for proceeding steps, reloading the progress line, and executing buttons in the Process Instance (available starting release 8.4)

Select the desired method in the "Form Action Type" picklist (34).

### Save

Check the **Disable Validation** checkbox in order to bypass form validation rules and save the data.\
Select a\*\* Success Message\*\*. Select "None" if no message is desired. To override the default message, select "Custom Message" and enter the desired **Message**.\
Configure **Extended Fields** if needed.

{% hint style="warning" %}
Only fields displayed on the form will be passed by default to the server when the form is saved. Defining **Extended Fields** allows any object fields to be passed and saved despite their absence on the form.
{% endhint %}

![](/files/59e1487e9167959b5662dfe192d9aa8d941996a4)

Starting the release 8.4 there are several improvements are added to Save action:

* **Ignore permissions** checkbox. Allows user to save changes in spite of user's permissions related to saved record.
* **Component**. Allows to select what to save. If select "current form", all changes in it will be saved. If select some list or related list, only changes that are made in it will be saved.

{% hint style="info" %}
To make lists changed user should turn "inline edit" feature on for them. Only changes made with inline editing will be saved.
{% endhint %}

{% hint style="warning" %}
Extended fields will be saved for each changed record in the list, not for all of them.
{% endhint %}

![](/files/9d7094ad1df90cf7c17f9d6604772b7e04be1556)

### Show notification

Select **Notification Type**.\
Enter the desired **Title** and **Text**.

![](/files/38c179975d95c9598dcf4adc5359050945dcd7a2)

### Validate

Select **where** validation should be performed.\
Configure the **Message** that will be displayed to users when validation fails.

![](/files/870dc21813585ef779496203df77dabf63e36633)

### Fire event

Populate the **Event Name** (in "namespace:name" format).\
Specify event **Parameters**, if needed.

![](/files/ce2a00820cd62cbb753861dfe5151ee58d1d7377)

### Execute form actions

Specify **Timeout** in order to optionally delay the form action execution.\
Select the **Form** and click the "Add" button.\
Based on which Form is selected (current form or nested form), the **Action** picklist will display a list of current form actions or nested form actions.\
Configure **Parameters** if needed.

If the **All Forms** checkbox is checked, the action can be executed from any form in your organization.

![](/files/6436b0c85973403f075c3fb65ed3d739d891967e)

{% hint style="info" %}
Form actions that are called by this action type can also be of an "Execute Form Actions" type, allowing the user to trigger a chain of Form Actions, even on different forms.
{% endhint %}

### Calculate

Configure calculation expressions. Specify the output variable Name and configure the Expression, which will result in the value of output variable. Several output variables may be configured.

Results of calculations should be passed to some other action (Result Handler).

![](/files/b06362c143d1877b8950635e1a871fa25cc88bc4)

Configure Parameters for the Result Handlers ("gear" icon) and select the desired Action (which should be already be configured on the form).

![](/files/523332f73006137e84abd11c04efd3f8ac68e505)

The Handler Action updates the specified form field with the calculation result:

![](/files/788676fa110997eaee1a0b694ec2199320d34ce1)

### Update process instance variables&#x20;

* Select the Process Instance from the list by clicking the configuration ("gear") icon or use the editor ("pencil" icon) to type the Process Instance ID or select a Merge Field
* Specify [Variables defined](https://w-r.screenstepslive.com/s/12930/m/64199/l/675045-process-actions-overview-and-types#action-types) on that Process Instance and their values

![](/files/5a38952ca68b7b4a7c30132783956632f5085a0e)

![](/files/da708c9e486c0a05de55b145b411931655bea637)

### Execute Workflow Line action

{% hint style="info" %}
This action type is available starting release 8.4.
{% endhint %}

Select the desired Action:

![](/files/4f154b9c1b5592844275c6c8e4d56f457c5cd471)

* **Proceed Step** - allows Proceed/Approve/Reject operations to be executed with the current step. Select the Operation and specify Comments, if desired:

  ![](/files/83244b88b1288d052df4a4bd6ae482ebc3e19a70)
* Reload Line - reloads the current Progress Bar with all of its components (this action is equal to the menu item of the same name in the Progress Bar menu).\
  Check "Reload Connected Instances" if you also want to reload visible subflows and connected processes.\
  Check "Reload All Instances on Page" (available starting release 8.7) to reload all Workflow Lines (e.g., if form has been insterted into some Lightning page with several Workflow Line components):

  ![](/files/be25f6913b3f834e5c21a76c81ea909b1414c665)
* Update Proceed Button - modifies the visibility and enablement of form buttons, as well as changing their labels (the text shown on buttons) and tooltips (the text shown when buttons are hovered over). Select the desired visibility/enablement setting and enter the desired label and tooltip, as needed:

  ![](/files/0e0e865f69fe6c1e598ea5197dbba69022787d0e)
