> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.generaltranslation.app/llms.txt
> Use this file to discover all available pages before exploring further.

> Learn how to use variables in Forms for Actions.

# Variables and helper functions

Variables allow you to access data contained in Forms and Flows to create custom business logic and automations.

Some basic considerations to using variables are:

* Variables are surrounded by curly brackets `{{ variable }}`.
* If a variable doesn't exist or can't be resolved, it has the same effect as an `undefined` variable.
* You can use nullish operators to handle `null` or `undefined` variables, for example:`{{fields.foo ?? fields.bar}}`.

## Available variables

You can use different types of variables to reference and transform data you gather from customers with Forms and Flows.

<table class="table">
  <thead>
    <tr>
      <th><strong>Variable</strong></th>
      <th><strong>Syntax</strong></th>
      <th><strong>Where</strong></th>
      <th><strong>Description</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Context</td>

      <td>
        `{{context.*}}`
      </td>

      <td>Forms / Flows</td>
      <td>Reference context data of the current transaction</td>
    </tr>

    <tr>
      <td>Form fields</td>

      <td>
        `{{fields.*}}`
      </td>

      <td>Forms / Flows</td>
      <td>Reference data from your form fields and hidden fields</td>
    </tr>

    <tr>
      <td>Shared variables</td>

      <td>
        `{{vars.*}}`
      </td>

      <td>Forms / Flows</td>
      <td>Reference data stored as shared variables</td>
    </tr>

    <tr>
      <td>Flow actions output</td>

      <td>
        `{{actions.*}}`
      </td>

      <td>Flows</td>
      <td>Reference data from the output response of previous flow actions</td>
    </tr>

    <tr>
      <td>Helper functions</td>

      <td>
        `{{functions.*}}`
      </td>

      <td>Forms / Flows</td>
      <td>Helper functions to transform data</td>
    </tr>
  </tbody>
</table>

### Context variables

Forms and flows automatically inherit context variables from the current transaction. You can access the following context variables:

* The `user` object, with access to the following properties:

  * `user.user_id`
  * `user.username`
  * `user.name`
  * `user.given_name`
  * `user.family_name`
  * `user.nickname`
  * `user.email`
  * `user.email_verified`
  * `user.phone_number`
  * `user.phone_verified`
  * `user.picture`
  * `user.user_metadata`
  * `user.app_metadata`
  * `user.created_at`
  * `user.updated_at`
  * `user.last_password_reset`
  * `user.identities`
* The `organization` object, with access to the following properties:

  * `organization.id`
  * `organization.name`
  * `organization.display_name`
  * `organization.metadata`
* The `client` object, with access to the following properties:

  * `client.client_id`
  * `client.name`
* The `tenant` object, with access to the following property:

  * `tenant.name`
* The `transaction` object, with access to the following property:

  * `transaction.state`

<Accordion title="Example of context object">
  ```json lines expandable theme={null}
  {
    "user": {
      "user_id": "auth0|658409...",
      "name": "ana@travel0.com",
      "nickname": "ana",
      "email": "ana@travel0.com",
      "email_verified": true,
      "picture": "https://s.gravatar.com/avatar/8eb1b522f6...",
      "user_metadata": {},
      "app_metadata": {},
      "created_at": "2023-12-21T09:46:40.487Z",
      "updated_at": "2024-05-07T10:44:26.271Z",
      "last_password_reset": "2023-12-21T09:49:08.932Z",
      "identities": [
        {
          "user_id": "6584...",
          "isSocial": false,
          "provider": "auth0",
          "connection": "Username-Password-Authentication"
        }
      ]
    },
    "client": {
      "client_id": "xpeg5...",
      "name": "My App"
    },
    "tenant": {
      "name": "tenant-testing"
    },
    "transaction": {
      "state": "hKFo2SBId2M0..."
    }
  }
  ```
</Accordion>

For example:  `{{context.user.user_id}}` references the `user_id` of the `user` object.

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/eTnlaUmP9KiNe1Wi/docs/images/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?fit=max&auto=format&n=eTnlaUmP9KiNe1Wi&q=85&s=5ffc0f342e01ec290f50771b2c6fe077" alt="Dashboard > Forms > Flows" data-og-width="1141" width="1141" data-og-height="219" height="219" data-path="docs/images/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/eTnlaUmP9KiNe1Wi/docs/images/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=280&fit=max&auto=format&n=eTnlaUmP9KiNe1Wi&q=85&s=30fd7fd3ae67323f7c7adb0bc53cd45b 280w, https://mintcdn.com/generaltranslationinc/eTnlaUmP9KiNe1Wi/docs/images/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=560&fit=max&auto=format&n=eTnlaUmP9KiNe1Wi&q=85&s=fc91b08e09ce95d89cd16cddde2f4c70 560w, https://mintcdn.com/generaltranslationinc/eTnlaUmP9KiNe1Wi/docs/images/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=840&fit=max&auto=format&n=eTnlaUmP9KiNe1Wi&q=85&s=fc5c9b9c6b6a24caabaecc5b76800a21 840w, https://mintcdn.com/generaltranslationinc/eTnlaUmP9KiNe1Wi/docs/images/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=1100&fit=max&auto=format&n=eTnlaUmP9KiNe1Wi&q=85&s=3b0fe22b3230a24f34b02ec870d09ee3 1100w, https://mintcdn.com/generaltranslationinc/eTnlaUmP9KiNe1Wi/docs/images/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=1650&fit=max&auto=format&n=eTnlaUmP9KiNe1Wi&q=85&s=72c299992c3732cb81a824ce63e76bd4 1650w, https://mintcdn.com/generaltranslationinc/eTnlaUmP9KiNe1Wi/docs/images/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=2500&fit=max&auto=format&n=eTnlaUmP9KiNe1Wi&q=85&s=d2720d265f0af05f58dfeba2e318162c 2500w" />
</Frame>

### Form fields variables

Field variables contain data collected from the user from input fields in the form and data from hidden fields. The data of each field varies depending on the field type. For example: `{{fields.first_name}}` references the input value of a field with the ID `first_name`.

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/gC1sp2cPcB7j7ynR/docs/images/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?fit=max&auto=format&n=gC1sp2cPcB7j7ynR&q=85&s=e86dfaaca3df9ecd2990f23e1b81ed99" alt="Dashboard > Actions > Forms > Form" data-og-width="1404" width="1404" data-og-height="497" height="497" data-path="docs/images/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/gC1sp2cPcB7j7ynR/docs/images/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=280&fit=max&auto=format&n=gC1sp2cPcB7j7ynR&q=85&s=1a7e0f27f64c4043b1329c45e43d7dfd 280w, https://mintcdn.com/generaltranslationinc/gC1sp2cPcB7j7ynR/docs/images/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=560&fit=max&auto=format&n=gC1sp2cPcB7j7ynR&q=85&s=bceb09bb486fe50f037722df9e6eb082 560w, https://mintcdn.com/generaltranslationinc/gC1sp2cPcB7j7ynR/docs/images/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=840&fit=max&auto=format&n=gC1sp2cPcB7j7ynR&q=85&s=6b978d17d7235e2a04112423ca7df76d 840w, https://mintcdn.com/generaltranslationinc/gC1sp2cPcB7j7ynR/docs/images/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=1100&fit=max&auto=format&n=gC1sp2cPcB7j7ynR&q=85&s=ce18b02180d944fbbb7d8c8366a9f45b 1100w, https://mintcdn.com/generaltranslationinc/gC1sp2cPcB7j7ynR/docs/images/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=1650&fit=max&auto=format&n=gC1sp2cPcB7j7ynR&q=85&s=3547a67ecb0352c069d079a3f440f753 1650w, https://mintcdn.com/generaltranslationinc/gC1sp2cPcB7j7ynR/docs/images/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=2500&fit=max&auto=format&n=gC1sp2cPcB7j7ynR&q=85&s=967d4d82ab29d1d4ab105bbbf7cb5726 2500w" />
</Frame>

### Flow output actions variables

When a flow action is executed, it generates an output object response that can be referenced in subsequent actions. For example: `{{actions.generate_otp.code}}` references the output code of the action with ID `generate_otp`.

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/Q_4pAdRoZm2wi1v5/docs/images/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?fit=max&auto=format&n=Q_4pAdRoZm2wi1v5&q=85&s=9d89a3848351fac9ec84a0fc95eb54b3" alt="Dashboard > Actions > Forms > Flows" data-og-width="1404" width="1404" data-og-height="253" height="253" data-path="docs/images/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/Q_4pAdRoZm2wi1v5/docs/images/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=280&fit=max&auto=format&n=Q_4pAdRoZm2wi1v5&q=85&s=28782ed3f773cea58dcca87790859445 280w, https://mintcdn.com/generaltranslationinc/Q_4pAdRoZm2wi1v5/docs/images/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=560&fit=max&auto=format&n=Q_4pAdRoZm2wi1v5&q=85&s=a0be35a4f8a0ecbeaca91cc9b29bb070 560w, https://mintcdn.com/generaltranslationinc/Q_4pAdRoZm2wi1v5/docs/images/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=840&fit=max&auto=format&n=Q_4pAdRoZm2wi1v5&q=85&s=78094396e275af883f204821863e01c6 840w, https://mintcdn.com/generaltranslationinc/Q_4pAdRoZm2wi1v5/docs/images/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=1100&fit=max&auto=format&n=Q_4pAdRoZm2wi1v5&q=85&s=2f2be31a603d178a30a0c16f2e171ced 1100w, https://mintcdn.com/generaltranslationinc/Q_4pAdRoZm2wi1v5/docs/images/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=1650&fit=max&auto=format&n=Q_4pAdRoZm2wi1v5&q=85&s=829dca3bc367677bb0c5a8e05cfd41c4 1650w, https://mintcdn.com/generaltranslationinc/Q_4pAdRoZm2wi1v5/docs/images/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=2500&fit=max&auto=format&n=Q_4pAdRoZm2wi1v5&q=85&s=8920779739e21f4d6b616d5fe484d2ac 2500w" />
</Frame>

### Shared variables

You can store variables to be shared with subsequent flows or even with form components in the same transaction. Shared variables are ephemeral and are associated with a specific form journey. Their values cannot be accessed outside of that journey. For example: `{{vars.external_id}}` references the value of a shared variable with ID `external_id`.

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/ZBZaCyGCDGYmrL4v/docs/images/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?fit=max&auto=format&n=ZBZaCyGCDGYmrL4v&q=85&s=5f59cc013d2100e5b27cc589ce5c9c26" alt="Dashboard > Actions > Forms > Flows" data-og-width="1215" width="1215" data-og-height="162" height="162" data-path="docs/images/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/ZBZaCyGCDGYmrL4v/docs/images/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=280&fit=max&auto=format&n=ZBZaCyGCDGYmrL4v&q=85&s=2a58878893d09e3b9c7f47ea8efc6892 280w, https://mintcdn.com/generaltranslationinc/ZBZaCyGCDGYmrL4v/docs/images/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=560&fit=max&auto=format&n=ZBZaCyGCDGYmrL4v&q=85&s=d0f0ba21e023422f9aab95e72773be2e 560w, https://mintcdn.com/generaltranslationinc/ZBZaCyGCDGYmrL4v/docs/images/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=840&fit=max&auto=format&n=ZBZaCyGCDGYmrL4v&q=85&s=33872ec9568dfff9e5e5d32044e8af63 840w, https://mintcdn.com/generaltranslationinc/ZBZaCyGCDGYmrL4v/docs/images/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=1100&fit=max&auto=format&n=ZBZaCyGCDGYmrL4v&q=85&s=766c684e01b1a4afdb5f0bbc59ff5e17 1100w, https://mintcdn.com/generaltranslationinc/ZBZaCyGCDGYmrL4v/docs/images/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=1650&fit=max&auto=format&n=ZBZaCyGCDGYmrL4v&q=85&s=9eacdbd3fcc03ccd85765c7736d70eed 1650w, https://mintcdn.com/generaltranslationinc/ZBZaCyGCDGYmrL4v/docs/images/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=2500&fit=max&auto=format&n=ZBZaCyGCDGYmrL4v&q=85&s=17154ccad79a26b97935a88f29eaab37 2500w" />
</Frame>

<Warning>
  Shared variables:

  * are internal (server-side) and not exposed to the browser (client-side).
  * can be resolved and exposed to the browser if you referenced a shared variable in the form component.
  * might have sensitive information, so take care when you access shared variable to avoid any unnecessary or unintentional exposure.
</Warning>

### Helper functions

Helper functions let you transform data and perform simple operations. For example: `{{functions.toString(fields.privacy_policies)}}` transform the value of the field with ID `privacy_policies` using the `toString()` function.

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=8c71b5632d7c5af49ab4cd9a8c6e8004" alt="Dashboard > Actions > Forms > Flows" data-og-width="1404" width="1404" data-og-height="290" height="290" data-path="docs/images/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=280&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=9bf7f4cca6e320cedcea3928ab06f4ff 280w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=560&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=1c3d69939f16b6d2b27e6adbeb1b844e 560w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=840&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=fcb2fba9f412c667c41c0729fefa3f5e 840w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=1100&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=0b9ffcb6a7334612a6b0d59543ba9598 1100w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=1650&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=d9545cf7ab3236ef599c4a7dce4aae65 1650w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=2500&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=c0b2283b7ec74dd6050064d4fb93605d 2500w" />
</Frame>

The available helper functions are:

<table class="table">
  <thead>
    <tr>
      <th><strong>Function</strong></th>
      <th><strong>Description</strong></th>
      <th><strong>Example</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>toArray(value)</code></td>
      <td>Converts value to an array.</td>

      <td>
        `{{ functions.toArray('abc') }} // ['abc']`
      </td>
    </tr>

    <tr>
      <td><code>toBoolean(value)</code></td>
      <td>Converts value to a boolean value.</td>

      <td>
        `{{ functions.toBoolean(1) }} // true&lt;br /&gt;&lt;br /&gt;\{\{ functions.toBoolean(0) }} // false`
      </td>
    </tr>

    <tr>
      <td><code>length(value)</code></td>
      <td>Returns the length of the parameter value.</td>

      <td>
        `{{ functions.length('auth0') }} // 5`
      </td>
    </tr>

    <tr>
      <td><code>mask(value)</code></td>
      <td>Masks a value to avoid be exposed in Executions.</td>

      <td>
        `{{ functions.mask('my_awesome_secret') }} // ███`
      </td>
    </tr>

    <tr>
      <td><code>toNumber(value)</code></td>
      <td>Converts value to a number.</td>

      <td>
        `{{ functions.toNumber('123') }} // 123`
      </td>
    </tr>

    <tr>
      <td><code>random(min, max, \[boolean])</code></td>
      <td>Returns a random number between the inclusive min and max.</td>

      <td>
        `{{ functions.random(0, 6) }} // 4 &lt;br /&gt;&lt;br /&gt;\{\{ functions.random(0, 6, true) }} // 3.8523497...`
      </td>
    </tr>

    <tr>
      <td><code>slice(value, start, end)</code></td>
      <td>Returns a section of a value array or string between the start and end indexes.</td>

      <td>
        `{{ functions.slice( 'example', 3, 5) }} // 'mp'`
      </td>
    </tr>

    <tr>
      <td><code>toString(value)</code></td>
      <td>Converts value to a string.</td>

      <td>
        `{{ functions.toString(123) }} // '123'`
      </td>
    </tr>

    <tr>
      <td><code>substring(value, start, end)</code></td>
      <td>Returns a section of a value between the start and end indexes. Read about the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring#differences_between_substring_and_slice">differences of slice and substring functions</a></td>

      <td>
        `{{ functions.substring( 'example’', 3, 5) }} // 'mp'`
      </td>
    </tr>

    <tr>
      <td><code>toTimestamp()</code></td>
      <td>Returns the current UNIX timestamp.</td>

      <td>
        `{{ functions.toTimestamp() }} // 1628761483`
      </td>
    </tr>

    <tr>
      <td><code>toTimestamp(date)</code></td>
      <td>Returns the provided date in UNIX time.</td>

      <td>
        `{{ functions.toTimestamp('2021-04-30T10:02:50.876Z') }} // 1619776970`
      </td>
    </tr>

    <tr>
      <td><code>toTimestamp(date)</code></td>
      <td>Returns the provided date in UNIX time.</td>

      <td>
        `{{ functions.toTimestamp('2021-04-30T10:02:50.876Z') }} // 1619776970`
      </td>
    </tr>

    <tr>
      <td><code>replaceAll(value, string, replacement)</code></td>
      <td>Returns a new string with all matches of a pattern replaced by a replacement.</td>

      <td>
        `{{ functions.replaceAll('2021-04-30', '-', '/') }} // 2021/04/30`
      </td>
    </tr>

    <tr>
      <td><code>replace(value, string, replacement)</code></td>
      <td>Returns a new string with all matches of a pattern replaced by a replacement. If pattern is a string, only the first occurence will be replaced.</td>

      <td>
        `{{ functions.replace('2021-04-30', '-', '/') }} // 2021/04-30`
      </td>
    </tr>

    <tr>
      <td><code>split(value, separator, limit?)</code></td>
      <td>Returns an ordered list of substrings divided by the separator.</td>

      <td>
        `{{ functions.split('2021-04-30', '-') }} // ['2021', '04', '30']`
      </td>
    </tr>

    <tr>
      <td><code>now()</code></td>
      <td>Returns the current date in ISO 8601 format.</td>

      <td>
        `{{ functions.now() }} // 2021-04-30T10:31:28.576Z`
      </td>
    </tr>

    <tr>
      <td><code>includes(collection, item, fromIndex?)</code></td>
      <td>Returns whether an array includes a certain value among its entries.</td>

      <td>
        `{{ functions.includes(['auth0', 'identity', 'authentication'], 'identity') }} // true`
      </td>
    </tr>

    <tr>
      <td><code>indexOf(collection, item, fromIndex?)</code></td>
      <td>Returns the first index at which a given element can be found in the array, or -1 if it is not present.</td>

      <td>
        `{{ functions.indexOf(['auth0', 'identity', 'authentication'], 'identity') }} // 1`
      </td>
    </tr>

    <tr>
      <td><code>merge(base, value)</code></td>
      <td>Returns a merged array, object or concatenates a string depending on the base data type.</td>

      <td>
        `{{ functions.merge(['auth0', 'identity'], ['authentication']) }} // ['auth0', 'identity', 'authentication']`
      </td>
    </tr>

    <tr>
      <td><code>md5(value)</code></td>
      <td>Returns a MD5 hashed value.</td>

      <td>
        `{{ functions.md5('auth0') }} // 7bbb597...`
      </td>
    </tr>

    <tr>
      <td><code>sha1(value)</code></td>
      <td>Returns a SHA1 hashed value.</td>

      <td>
        `{{ functions.sha1('auth0') }} // b4ec5339...`
      </td>
    </tr>

    <tr>
      <td><code>sha256(value)</code></td>
      <td>Returns a SHA256 hashed value.</td>

      <td>
        `{{ functions.sha256('auth0') }} // d9082bdc...`
      </td>
    </tr>

    <tr>
      <td><code>sha512(value)</code></td>
      <td>Returns a SHA512 hashed value.</td>

      <td>
        `{{ functions.sha512('auth0') }} // c0d588069d...`
      </td>
    </tr>

    <tr>
      <td><code>uuid()</code></td>
      <td>Returns a random v4 UUID.</td>

      <td>
        `{{ functions.uuid() }} // 36b8f84d-df4e-4d49-b662-bcde71a8764`
      </td>
    </tr>
  </tbody>
</table>

## Variables best practices

### Use meaningful IDs

When you add a Form field or a Flow action, the ID is automatically generated.

Update the ID to a more descriptive value so you can identify the information it contains. For example, if you create a Form field that stores the user’s first name, update the ID to `first_name`.

### Be mindful when updating existing IDs

If a variable is already in use and you need to modify the ID, identify where you have referenced it and update the ID accordingly to avoid undefined or empty values.

### Check Flow executions

If you see an unexpected variable value, use the [**Executions**](/docs/customize/forms/flows/flow-execution-and-debugger) view to troubleshoot the variable.

### Use the autocomplete menu

The autocomplete menu helps you locate and properly reference existing variables.

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/RMdEvk9xid_26wCJ/docs/images/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?fit=max&auto=format&n=RMdEvk9xid_26wCJ&q=85&s=6742f9bd72b6ac2e75f4f820c9bd037f" alt="Dashboard > Actions > Forms > Flows" data-og-width="1361" width="1361" data-og-height="502" height="502" data-path="docs/images/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/RMdEvk9xid_26wCJ/docs/images/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=280&fit=max&auto=format&n=RMdEvk9xid_26wCJ&q=85&s=5dad8b68761382203a317abe8523ea0d 280w, https://mintcdn.com/generaltranslationinc/RMdEvk9xid_26wCJ/docs/images/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=560&fit=max&auto=format&n=RMdEvk9xid_26wCJ&q=85&s=7cbf9f880f79f8f9a67879df36e631a0 560w, https://mintcdn.com/generaltranslationinc/RMdEvk9xid_26wCJ/docs/images/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=840&fit=max&auto=format&n=RMdEvk9xid_26wCJ&q=85&s=d9b39de6f4664a38549ffa4594b5b106 840w, https://mintcdn.com/generaltranslationinc/RMdEvk9xid_26wCJ/docs/images/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=1100&fit=max&auto=format&n=RMdEvk9xid_26wCJ&q=85&s=3f485ec30f8dcd928814da5b995ed400 1100w, https://mintcdn.com/generaltranslationinc/RMdEvk9xid_26wCJ/docs/images/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=1650&fit=max&auto=format&n=RMdEvk9xid_26wCJ&q=85&s=9e86171649400c1cd0da8e07f3b4d196 1650w, https://mintcdn.com/generaltranslationinc/RMdEvk9xid_26wCJ/docs/images/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=2500&fit=max&auto=format&n=RMdEvk9xid_26wCJ&q=85&s=13b312a1e4fbd5ef6854d307f0a92967 2500w" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/bJAwjuRiJwaYWdNy/docs/images/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?fit=max&auto=format&n=bJAwjuRiJwaYWdNy&q=85&s=0cf7bc65ac043ae4abc3abbb51e6fd00" alt="Dashboard > Actions > Forms > Form" data-og-width="1394" width="1394" data-og-height="630" height="630" data-path="docs/images/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/bJAwjuRiJwaYWdNy/docs/images/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=280&fit=max&auto=format&n=bJAwjuRiJwaYWdNy&q=85&s=ce07a479524b26a912a7666a23e3baff 280w, https://mintcdn.com/generaltranslationinc/bJAwjuRiJwaYWdNy/docs/images/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=560&fit=max&auto=format&n=bJAwjuRiJwaYWdNy&q=85&s=04f6f30f7c698b67f6de1499574ad3f8 560w, https://mintcdn.com/generaltranslationinc/bJAwjuRiJwaYWdNy/docs/images/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=840&fit=max&auto=format&n=bJAwjuRiJwaYWdNy&q=85&s=e66d8fe3067ad2ece11f23e943984062 840w, https://mintcdn.com/generaltranslationinc/bJAwjuRiJwaYWdNy/docs/images/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=1100&fit=max&auto=format&n=bJAwjuRiJwaYWdNy&q=85&s=de9786e7caac5e0763b81c789f19c012 1100w, https://mintcdn.com/generaltranslationinc/bJAwjuRiJwaYWdNy/docs/images/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=1650&fit=max&auto=format&n=bJAwjuRiJwaYWdNy&q=85&s=9106da6debe55b1d8c55ce2acef27155 1650w, https://mintcdn.com/generaltranslationinc/bJAwjuRiJwaYWdNy/docs/images/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=2500&fit=max&auto=format&n=bJAwjuRiJwaYWdNy&q=85&s=db59452106b8ab0a868ac793f4317480 2500w" />
</Frame>
