# Set Variable

### Overview

The **Set Variable** Action is used to change the value of a Variable based on the value of any other Variable or Airscript expression. It has many uses, including setting the validation state of a form to **TRUE** or **FALSE** based on user input, or combining two different values from a form.

![organizing info](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-922c2f3dd7abb4ea94e4cae5f0d5e8134fb4ff3a%2Fthe-set-variable-action-v1715-0.gif?alt=media)

&#x20;

### Use Cases

* Variables can be used to track whether a user's entry is valid and modify the UI appropriately, as seen in [Validation of Forms & User Data](../building-apps/working-with-forms-agreements/validation-of-user-data).
* A Variable can be used as the text value of a Label, and changed dynamically using the Set Variable Action.
* The Set Variable Action can be used to consolidate data to be used in a Data Flow. For instance, if the user enters their email in one Web Flow, the Set Variable Action can be used to save it to the session, with `session.user_email = activity.user_email`.
  * If the user later opens a new Web Flow to escalate their case, the `session.user_email` Variable can then be passed into a Data Flow to create a Zendesk Ticket populated with the user's information.
* The Set Variable Action can be used to bind two controls together. For instance, a Map component and a Place Search Input component could be bound together.
  * When the user scrolls the Map, the Place Search Input updates to the new address under the marker.
  * When the user types an address into the Place Search Input, the Map scrolls to center on the new address.

### Action Properties

#### Variable

The Variable whose value will be changed by this action.

#### Value

The new value for the specified Variable. The value can be any Airscript expression, including the original Variable itself, or any Airscript function that returns the same type as the Variable.

In the example below, `email_is_valid` will be set to **TRUE** if the `email_input` Variable contains a valid email, or **FALSE** if it does not.

![organizing info](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-05b3f305d0f92b1ec1fe1005797ef0c157fb0f67%2Fthe-set-variable-action-v1715-1.png?alt=media)
