> 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/automations/global-actions-and-action-groups/best-practices/how-to-use-form-virtual-fields-values-in-action.md).

# How to use form virtual fields values in Action

The Form in the example is using Account as a source object.

1. Open your form.

2. Add text virtual field to your form.

3. Provide a title and unique field name.<br>

   ![](/files/1f336453bb7314fb8d129e98beeb048ca74b2ad0)

4. Save a form.

5. Create an Action. [How to create an Action](/automations/global-actions-and-action-groups/basics/working-with-actions.md#how-to-create-an-action).

6. Choose the **Account** as a context object type for your action.

7. Choose '**Email Alert**' action type.

8. Choose **Advanced** mode on Email Alert Settings section.

9. Open your form and copy the virtual field name.

10. Get this virtual field value using $Environment object: `{$Environment.vf_subscribtion_email}`. \
    Put this expression into 'To' input on email alert action.

11. Fill in Email Subject and Email Body inputs.

12. Save the Action.<br>

    ![](/files/7a54695d328950ad67893aeb6775672bb2bc2b37)

13. Add new custom button "Subscribe" to your form.

14. Add new Action "Activate Subscription" to your Form to call the Global Action you've created. See more info on creating actions in [Actions](/forms/form-building/form-action.md) article.<br>

    ![](/files/1707496c87c88fcaef4746b3d04cc46f9f09e5bf)

15. Add onClick event to the Subscribe button with handler "Activate Subscription".

    See details in [Events](/forms/form-building/events.md) article.

16. Save your changes.

**Now let's check:**

1. Run the form.
2. Fill in Email virtual input with your email.
3. Click custom button.
4. Following email will be sent to you.<br>

   ![](/files/efbf9dda265562a35c266767e5814a20c5e82e79)
