> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-fix-ss-log-app-metadata-user-metadata-clarification.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables et fonctions utilitaires

> Apprenez à utiliser les variables dans les Formulaires pour les Actions.

Les variables vous permettent d’accéder aux données contenues dans les Formulaires et les Flux pour créer une logique commerciale et des automatismes personnalisés.

Voici quelques considérations de base sur l’utilisation des variables :

* Les variables sont entourées d’accolades `{{ variable }}`.
* Si une variable n’existe pas ou ne peut pas être résolue, elle a le même effet qu’une variable dont la valeur est `undefined (indéfini)`.
* Vous pouvez utiliser des opérateurs nuls pour gérer les variables dont la valeur est `null` ou `undefined`, par exemple :`{{fields.foo ?? fields.bar}}`.

## Variables disponibles

Vous pouvez utiliser différents types de variables pour référencer et transformer les données que vous recueillez auprès des clients avec les Formulaires et les Flux.

| Variable                   | \_Syntax          | Where              | Description                                                                  |
| -------------------------- | ----------------- | ------------------ | ---------------------------------------------------------------------------- |
| Contexte                   | `{{contexte.*}}`  | Formes / Flux      | Données contextuelles de référence de la transaction en cours                |
| Champs de formulaire       | `{{fields. *}}`   | Formulaires / Flux | Données de référence des champs de votre formulaire et des champs cachés     |
| Variables partagées        | `{{vars.*}}`      | Formulaires / Flux | Données de référence stockées en tant que variables partagées                |
| Sortie des actions de flux | `{{actions. *}}`  | Flux               | Données de référence de la réponse de sortie des actions de flux précédentes |
| Fonctions d’aide           | `{{fonctions.*}}` | Formulaires / Flux | Fonctions d’aide pour transformer les données                                |

### Variables de contexte

Les Formulaires et les Flux héritent automatiquement des variables de contexte de la transaction en cours. Vous pouvez accéder aux variables de contexte suivantes :

* L’objet `user`, avec accès aux propriétés suivantes :

  * `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`
* L’objet `organization`, avec accès aux propriétés suivantes :

  * `organization.id`
  * `organization.name`
  * `organization.display_name`
  * `organization.metadata`
* L’objet `client`, avec accès aux propriétés suivantes :

  * `client.client_id`
  * `client.name`
* L’objet `tenant (locataire)`, avec accès à la propriété suivante :

  * `tenant.name`
* L’objet `transaction`, avec accès à la propriété suivante :

  * `transaction.state`

<Accordion title="Exemple d’objet contextuel">
  ```json lines 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>

Par exemple :  `{{context.user.user_id}}` référence `user_id` de l’objet `user`.

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=2aa92044712e4162600479848c4f1b24" alt="Dashboard > Forms > Flows" data-og-width="1141" width="1141" data-og-height="219" height="219" data-path="docs/images/fr-ca/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=280&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=b1b0ec25efb971df730428a1a7ab8192 280w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=560&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=ae4b73228e31829dfafe7498d834c379 560w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=840&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=69e2f0dcc33576375b71c496b0bbe4bc 840w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=1100&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=aee8c33b74e2b22de69c76bb90877d8e 1100w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=1650&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=005bc15d2133596fefc468d6ad934287 1650w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/3B8DRhXO2wGqeqSFb8KbQv/0a61cdbbb7f1d290950a2ddb9857aac3/Contex-variable.png?w=2500&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=31d999820bdd6dada706b6d7bdbf264f 2500w" />
</Frame>

### Variables des champs du formulaire

Les variables de champ contiennent les données recueillies auprès de l’utilisateur dans les champs de saisie du formulaire et les données des champs cachés. Les données de chaque champ varient en fonction du type de champ. Par exemple : `{{fields.first_name}}` référence la valeur saisie dans le champ ayant l’ID `first_name`.

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=83aff26ba016e49a2fd4370b62f51a39" alt="Dashboard > Actions > Forms > Form" data-og-width="1404" width="1404" data-og-height="497" height="497" data-path="docs/images/fr-ca/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=280&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=6b6093f0a91557b7684719dade118155 280w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=560&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=8abfc59c70c54ac64c580cf4a02b3fd9 560w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=840&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=5f4ed1bf9d9451ed5731a47ba8349526 840w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=1100&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=92fa977056ebead0c07357327953b9ef 1100w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=1650&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=80521bf4c0432cafb360fc4602d0a2ce 1650w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4D42A6ww4XvFxweoxh04Rd/016c2ed9d25bc2267ed3ed31bf8b2bf6/form-fields-variable.png?w=2500&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=4e060b6ad8252d8ec1a9b740f1f729af 2500w" />
</Frame>

### Variables des actions de sortie de flux

Lorsqu’une action de flux est exécutée, elle génère un objet qui peut être référencé dans les actions suivantes. Par exemple : `{{actions.generate_otp.code}}` référence le code résultant de l’action avec l’ID`generate_otp`.

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/W55HAuBpdmevfyQU/docs/images/fr-ca/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?fit=max&auto=format&n=W55HAuBpdmevfyQU&q=85&s=ee512b9937071f6c984bcb6d7c5d2d35" alt="Dashboard > Actions > Forms > Flows" data-og-width="1404" width="1404" data-og-height="253" height="253" data-path="docs/images/fr-ca/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/W55HAuBpdmevfyQU/docs/images/fr-ca/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=280&fit=max&auto=format&n=W55HAuBpdmevfyQU&q=85&s=4abd4806ea3eb244fd0866a6e3fe0757 280w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/W55HAuBpdmevfyQU/docs/images/fr-ca/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=560&fit=max&auto=format&n=W55HAuBpdmevfyQU&q=85&s=3a50365b294cb4035fd0f64ea0fda26c 560w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/W55HAuBpdmevfyQU/docs/images/fr-ca/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=840&fit=max&auto=format&n=W55HAuBpdmevfyQU&q=85&s=8724a3d0199c88f39f9c634057be3c5f 840w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/W55HAuBpdmevfyQU/docs/images/fr-ca/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=1100&fit=max&auto=format&n=W55HAuBpdmevfyQU&q=85&s=5b0f56129be89322e4eeb034c43aa8b9 1100w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/W55HAuBpdmevfyQU/docs/images/fr-ca/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=1650&fit=max&auto=format&n=W55HAuBpdmevfyQU&q=85&s=b32c4b346f9b4c0a3d976b72b5fa2800 1650w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/W55HAuBpdmevfyQU/docs/images/fr-ca/cdy7uua7fh8z/6jYtEdYqSGXm3DDv0mxQ0o/2d48012629745e07137bf6ba42f4d829/flow-output-variable.png?w=2500&fit=max&auto=format&n=W55HAuBpdmevfyQU&q=85&s=e2e1d25e62c9c7300159396335437182 2500w" />
</Frame>

### Variables partagées

Vous pouvez stocker des variables à partager avec des flux ultérieurs ou même avec des composants de formulaire dans la même transaction. Les variables partagées sont éphémères et sont associées à un parcours de formulaire spécifique. Leurs valeurs ne sont pas accessibles en dehors de ce parcours. Par exemple : `{{vars.external_id}}` référence la valeur d’une variable partagée avec l’ID `external_id`.

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=c1c734c233f80861be07f9cfa99749a5" alt="Dashboard > Actions > Forms > Flows" data-og-width="1215" width="1215" data-og-height="162" height="162" data-path="docs/images/fr-ca/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=280&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=a6c3420dd2af7dc4b66c01bd3fd13c50 280w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=560&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=4bfd30073eb4426babf69eb91f5cb802 560w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=840&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=4f9d5d4226a25a8648b99492a673cb85 840w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=1100&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=43999926871470d5ac8300d5f2b12ab3 1100w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=1650&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=6f464190396f2d097037e9df21f949c2 1650w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/4571ExRTHL0KZKJKX9pNwj/abb631b8608a6356b0e5b3784cf8b02f/flow-shared-variable.png?w=2500&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=b5a6657e0352292cf901fd973989b850 2500w" />
</Frame>

<Warning>
  Variables partagées :

  * elles sont internes (côté serveur) et ne sont pas exposées au navigateur (côté client).
  * elle peuvent être résolues et exposées au navigateur si vous avez référencé une variable partagée dans le composant de formulaire.
</Warning>

### Fonctions utilitaires

Les fonctions utilitaires permettent de transformer les données et d’effectuer des opérations simples. Par exemple : `{{functions.toString(fields.privacy_policies)}}` transforme la valeur du champ ayant l’ID `privacy_policies` utilisant la fonction `toString()`.

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/HJ8TpHi0HqCU77x8/docs/images/fr-ca/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?fit=max&auto=format&n=HJ8TpHi0HqCU77x8&q=85&s=89efe4850fcf35feefeb83e4206830b4" alt="Dashboard > Actions > Forms > Flows" data-og-width="1404" width="1404" data-og-height="290" height="290" data-path="docs/images/fr-ca/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/HJ8TpHi0HqCU77x8/docs/images/fr-ca/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=280&fit=max&auto=format&n=HJ8TpHi0HqCU77x8&q=85&s=a11b1520e4f0369ed075505f4b1002ce 280w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/HJ8TpHi0HqCU77x8/docs/images/fr-ca/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=560&fit=max&auto=format&n=HJ8TpHi0HqCU77x8&q=85&s=ca146a148872969eb1149e04dd9733e1 560w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/HJ8TpHi0HqCU77x8/docs/images/fr-ca/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=840&fit=max&auto=format&n=HJ8TpHi0HqCU77x8&q=85&s=f61d94082a639184e6daf7881406042a 840w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/HJ8TpHi0HqCU77x8/docs/images/fr-ca/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=1100&fit=max&auto=format&n=HJ8TpHi0HqCU77x8&q=85&s=f31e291a00bf40e573ebd0e1ab9ff5dc 1100w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/HJ8TpHi0HqCU77x8/docs/images/fr-ca/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=1650&fit=max&auto=format&n=HJ8TpHi0HqCU77x8&q=85&s=1edd9e05d1bdb8eb43659826f4039e90 1650w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/HJ8TpHi0HqCU77x8/docs/images/fr-ca/cdy7uua7fh8z/1gyox33XJEtdkT43NppblT/0e878cc5ae2bde11b4207e105bbac6c5/flow-helper-functions.png?w=2500&fit=max&auto=format&n=HJ8TpHi0HqCU77x8&q=85&s=a5100cdbb36c192e99c76cc0b22fcf8b 2500w" />
</Frame>

Les fonctions utilitaires disponibles sont les suivantes :

| Fonction                               | Description                                                                                                                                                                                                                                                                                   | Exemple                                                                                                          |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| toArray(value)                         | Convertit la valeur en un tableau                                                                                                                                                                                                                                                             | {"{{ functions.toArray('abc') }}"} // \['abc']                                                                   |
| toBoolean(value)                       | Convertit la valeur en valeur booléenne                                                                                                                                                                                                                                                       | {"{{ functions.toBoolean(1) }}"} // true<br /><br />{"{{ functions.toBoolean(0) }}"} // false                    |
| length(value)                          | Renvoie la longueur de la valeur du paramètre                                                                                                                                                                                                                                                 | {"{{ functions.length('auth0') }}"} // 5                                                                         |
| mask(value)                            | Masque une valeur pour éviter l’exposition dans les exécutions                                                                                                                                                                                                                                | {"{{ functions.mask('my_awesome_secret') }}"} // ███                                                             |
| toNumber(value)                        | Convertit la valeur en nombre                                                                                                                                                                                                                                                                 | {"{{ functions.toNumber('123') }}"} // 123                                                                       |
| random(min, max, \[boolean])           | Renvoie un nombre aléatoire compris entre les valeurs minimales et maximales incluses.                                                                                                                                                                                                        | {"{{ functions.random(0, 6) }}"} // 4<br /><br />{"{{ functions.random(0, 6, true) }}"} // 3.8523497...          |
| slice(value, start, end)               | Renvoie une section d’un tableau de valeurs ou d’une chaîne de caractères entre les indices de début et de fin.                                                                                                                                                                               | {"{{ functions.slice( 'example', 3, 5) }}"} // 'mp'                                                              |
| toString(value)                        | Convertit la valeur en chaîne                                                                                                                                                                                                                                                                 | {"{{ functions.toString(123) }}"} // '123'                                                                       |
| substring(value, start, end)           | Renvoie une section d’une valeur entre les indices de début et de fin. En savoir plus sur les [différences entre les fonctions slice et substring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring#differences_between_substring_and_slice) | {"{{ functions.substring( 'example', 3, 5) }}"} // 'mp'                                                          |
| toTimestamp()                          | Renvoie l’horodatage UNIX actuel                                                                                                                                                                                                                                                              | {"{{ functions.toTimestamp() }}"} // 1628761483                                                                  |
| toTimestamp(date)                      | Renvoie la date fournie en heure UNIX                                                                                                                                                                                                                                                         | {"{{ functions.toTimestamp('2021-04-30T10:02:50.876Z') }}"} // 1619776970                                        |
| toTimestamp(date)                      | Renvoie la date fournie en heure UNIX                                                                                                                                                                                                                                                         | {"{{ functions.toTimestamp('2021-04-30T10:02:50.876Z') }}"} // 1619776970                                        |
| replaceAll(value, string, replacement) | Renvoie une nouvelle chaîne dans laquelle toutes les correspondances d’un modèle sont remplacées par un substitut.                                                                                                                                                                            | {"{{ functions.replaceall('2021-04-30', '-', '/') }}"} // 2021/04/30                                             |
| replace(value, string, replacement)    | Renvoie une nouvelle chaîne dans laquelle toutes les correspondances d’un modèle sont remplacées par un substitut. Si le motif est une chaîne, seule la première occurrence sera remplacée.                                                                                                   | {"{{ functions.replace('2021-04-30', '-', '/') }}"} // 2021/04-30                                                |
| split(value, separator, limit?)        | Renvoie une liste ordonnée de sous-chaînes divisées par le séparateur.                                                                                                                                                                                                                        | {"{{ functions.split('2021-04-30', '-') }}"} // \['2021', '04', '30']                                            |
| now()                                  | Renvoie la date actuelle au format ISO 8601.                                                                                                                                                                                                                                                  | {"{{ functions.now() }}"} // 2021-04-30T10:31:28.576Z                                                            |
| includes(collection, item, fromIndex?) | Renvoie le fait qu’un tableau contienne une certaine valeur parmi ses entrées.                                                                                                                                                                                                                | {"{{ functions.includes(['auth0', 'identity', 'authentication'], 'identity') }}"} // true                        |
| indexOf(collection, item, fromIndex?)  | Renvoie le premier indice auquel un élément donné peut être trouvé dans le tableau, ou -1 s’il n’est pas présent.                                                                                                                                                                             | {"{{ functions.indexOf(['auth0', 'identity', 'authentication'], 'identity') }}"} // 1                            |
| merge(base, value)                     | Renvoie un tableau fusionné, un objet ou concatène une chaîne de caractères en fonction du type de données de base.                                                                                                                                                                           | {"{{ functions.merge(['auth0', 'identity'], ['authentication']) }}"} // \['auth0', 'identity', 'authentication'] |
| md5(value)                             | Renvoie une valeur hachée MD5.                                                                                                                                                                                                                                                                | {"{{ functions.md5('auth0') }}"} // 7bbb597...                                                                   |
| sha1(value)                            | Renvoie une valeur hachée SHA1.                                                                                                                                                                                                                                                               | {"{{ functions.sha1('auth0') }}"} // b4ec5339...                                                                 |
| sha256(value)                          | Renvoie une valeur hachée SHA256.                                                                                                                                                                                                                                                             | {"{{ functions.sha256('auth0') }}"} // d9082bdc...                                                               |
| sha512(value)                          | Renvoie une valeur hachée SHA512.                                                                                                                                                                                                                                                             | {"{{ functions.sha512('auth0') }}"} // c0d588069d...                                                             |
| uuid()                                 | Renvoie un UUID v4 aléatoire                                                                                                                                                                                                                                                                  | {"{{ functions.uuid() }}"} // 36b8f84d-df4e-4d49-b662-bcde71a8764                                                |

## Meilleures pratiques pour les variables

### Utiliser des ID significatifs

Lorsque vous ajoutez un champ de Formulaire ou une action de Flux, l’ID est automatiquement généré.

Mettez à jour l’ID avec une valeur plus descriptive afin de pouvoir identifier les informations qu’il contient. Par exemple, si vous créez un champ de Formulaire qui stocke le prénom de l’utilisateur, modifiez l’ID en `first_name`.

### Soyez vigilant lorsque vous mettez à jour des ID existants

Si une variable est déjà utilisée et que vous devez modifier son ID, identifiez l’endroit où vous l’avez référencée et mettez l’ID à jour en conséquence pour éviter les valeurs indéfinies ou vides.

### Vérifier l’exécution des Flux

Si vous constatez une valeur de variable inattendue, utilisez l’aperçu [**Executions (Exécutions)**](/docs/fr-ca/customize/forms/flows/flow-execution-and-debugger) pour dépanner la variable.

### Utiliser le menu de remplissage automatique

Le menu de remplissage automatique vous aide à localiser et à référencer correctement les variables existantes.

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=11c5bab9ce4d00f799f755209e8614cc" alt="Dashboard > Actions > Forms > Flows" data-og-width="1361" width="1361" data-og-height="502" height="502" data-path="docs/images/fr-ca/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=280&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=95a70f70e06a78995977292c4f719ce7 280w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=560&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=a53fba97cb644bd17105468457df2fba 560w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=840&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=c7ef61af65017fa98e6c0712794ebd4e 840w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=1100&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=0d528214f27921cafb8f93901cab4b97 1100w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=1650&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=b0c417a02347f477668e491db7157e2e 1650w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/yZJelH9BKdqFeN2T/docs/images/fr-ca/cdy7uua7fh8z/3SKnDuaMzSImxZtDDAoZaz/9ea800fad29ef71d1ded3c72b87660a4/Autocomplete-flows.png?w=2500&fit=max&auto=format&n=yZJelH9BKdqFeN2T&q=85&s=3d59c96a0765bc3bd4b6767798cf6e43 2500w" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=3978c2459ac3ad05c51b790fcd19d498" alt="Dashboard > Actions > Forms > Form" data-og-width="1394" width="1394" data-og-height="630" height="630" data-path="docs/images/fr-ca/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=280&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=b1bba0e478d58513950fc5efd82f60df 280w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=560&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=6bf9fe165c395e9c739465ce0cac3ec0 560w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=840&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=edabd1298b8d594d234898ad1a345d9a 840w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=1100&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=d45127053f85967e83b1e28e5b2df5db 1100w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=1650&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=4fd863aed4d046e6c83f1fc4f8a91643 1650w, https://mintcdn.com/docs-dev-fix-ss-log-app-metadata-user-metadata-clarification/zrxMS5eBGDWJi8_Y/docs/images/fr-ca/cdy7uua7fh8z/2kjRKozVgrd2a7UJXOANaN/ee5452d7210cd2f13b0e97763f11c82a/Autocomplete-forms.png?w=2500&fit=max&auto=format&n=zrxMS5eBGDWJi8_Y&q=85&s=b272b863ed3815a41950878e8f14f839 2500w" />
</Frame>
