> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-chore-myaccount-api-autoupdate.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Apprenez à configurer un formulaire de profil progressif à l’aide de Forms for Actions

# Cas d’utilisation : configurer un formulaire de profil progressif avec Forms

<Card title="Avant de commencer">
  1. Créez une [application machine-to-machine](/docs/fr-ca/get-started/auth0-overview/create-applications/machine-to-machine-apps) avec les portées suivantes activées :

  * `read:users`
  * `update:users`
  * `create:users`
  * `read:users_app_metadata`
  * `update:users_app_metadata`
  * `create:users_app_metadata`

  2. Ajoutez une [connexion Vault](/docs/fr-ca/customize/forms/vault) à l’aide des informations d’identification de l’application M2M.
</Card>

Forms for Actions vous permet de créer des flux de profil progressif afin de déterminer à quel moment demander aux utilisateurs de fournir les renseignements manquants, comme le nom de l’entreprise et le titre du poste, et de les stocker comme attributs `user_metadata`.

<Frame>
  <img src="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/1mTQDIvhZ-Lcazsq/docs/images/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?fit=max&auto=format&n=1mTQDIvhZ-Lcazsq&q=85&s=5cafd51ae89922ce6a472c9d514e699e" alt="Dashboard > Actions > Forms > Form" data-og-width="1404" width="1404" data-og-height="638" height="638" data-path="docs/images/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/1mTQDIvhZ-Lcazsq/docs/images/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=280&fit=max&auto=format&n=1mTQDIvhZ-Lcazsq&q=85&s=f9173144c45d4b3c296ff531cb39da1e 280w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/1mTQDIvhZ-Lcazsq/docs/images/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=560&fit=max&auto=format&n=1mTQDIvhZ-Lcazsq&q=85&s=eef7dde500beede62cdafaa2a41546f1 560w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/1mTQDIvhZ-Lcazsq/docs/images/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=840&fit=max&auto=format&n=1mTQDIvhZ-Lcazsq&q=85&s=a91185536ee69e0c27e792a13d23ddd3 840w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/1mTQDIvhZ-Lcazsq/docs/images/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=1100&fit=max&auto=format&n=1mTQDIvhZ-Lcazsq&q=85&s=e8bc315db57188de35fdb5409de6883d 1100w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/1mTQDIvhZ-Lcazsq/docs/images/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=1650&fit=max&auto=format&n=1mTQDIvhZ-Lcazsq&q=85&s=4e06baedc9338b060482ae7794b0888c 1650w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/1mTQDIvhZ-Lcazsq/docs/images/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=2500&fit=max&auto=format&n=1mTQDIvhZ-Lcazsq&q=85&s=707241d3811c8995ba439ff7dd800ff5 2500w" />
</Frame>

Les sections ci-dessous expliquent comment créer un formulaire de profil progressif à l’aide de nœuds et de flux, ainsi que les étapes à suivre pour ajouter votre formulaire à une [Action Post Login](/docs/fr-ca/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger).

<h2 id="create-a-form-from-scratch">
  Créer un formulaire à partir de zéro
</h2>

Suivez ces étapes pour créer un formulaire et recueillir des renseignements :

1. Ouvrez l’éditeur de formulaires en sélectionnant **Auth0 Dashboard > Actions > Forms.**
2. Sélectionnez **Create Form** > **Start from scratch**.

Par défaut, un nouveau formulaire contient un nœud Start, un nœud Step et un nœud Ending screen.

<Frame>
  <img src="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/xjbLFTbb3mNkqhP2/docs/images/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?fit=max&auto=format&n=xjbLFTbb3mNkqhP2&q=85&s=626e8e4b4a558105ec3bc1d9728ad506" alt="Dashboard > Forms > Cas d’utilisation > Formulaire" data-og-width="1234" width="1234" data-og-height="371" height="371" data-path="docs/images/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/xjbLFTbb3mNkqhP2/docs/images/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=280&fit=max&auto=format&n=xjbLFTbb3mNkqhP2&q=85&s=bed0c3ac0b9a2bba9a7fa4263582c4d6 280w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/xjbLFTbb3mNkqhP2/docs/images/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=560&fit=max&auto=format&n=xjbLFTbb3mNkqhP2&q=85&s=437ae6cd8819a989ae0aa8a9e722360e 560w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/xjbLFTbb3mNkqhP2/docs/images/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=840&fit=max&auto=format&n=xjbLFTbb3mNkqhP2&q=85&s=86abeb65a6d975f3c9608d3332b02e33 840w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/xjbLFTbb3mNkqhP2/docs/images/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=1100&fit=max&auto=format&n=xjbLFTbb3mNkqhP2&q=85&s=5f121720a4068308e4d65caef9cd8a8d 1100w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/xjbLFTbb3mNkqhP2/docs/images/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=1650&fit=max&auto=format&n=xjbLFTbb3mNkqhP2&q=85&s=455f12f3596ed4f0aee4dc81955a8b9a 1650w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/xjbLFTbb3mNkqhP2/docs/images/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=2500&fit=max&auto=format&n=xjbLFTbb3mNkqhP2&q=85&s=90874a428dada9f35e827291a078a4a6 2500w" />
</Frame>

<h3 id="configure-the-step-node">
  Configurer le nœud Step
</h3>

Le nœud Step est l’interface graphique que voient les utilisateurs. Ajoutez des [champs](/docs/fr-ca/customize/forms/nodes-and-components) au nœud Step pour recueillir le nom de l’entreprise et l’intitulé du poste de l’utilisateur en suivant ces étapes :

1. Faites glisser un champ **Rich text** du **menu Components** vers le nœud **Step**.

   * **Rich text** : Saisissez un message personnalisé.

     * **Exemple** : `Complétez votre profil ! Nous avons besoin de quelques renseignements pour personnaliser votre expérience.`
   * Sélectionnez **Enregistrer**.
2. Faites glisser un champ **Text** vers le nœud **Step**.

   * **ID** : Saisissez `company_name`.
   * **Label** : Cochez la case.
   * **Label** : Saisissez `Nom de l’entreprise`.
   * **Required** : Cochez la case.
   * Sélectionnez **Enregistrer**.
3. Faites glisser un champ **Text** vers le nœud **Step**.

   1. **ID** : Saisissez `job_title`.
   2. **Label** : Saisissez `Titre du poste`.
   3. **Label** : Cochez la case.
   4. **Required** : Cochez la case.
   5. Sélectionnez **Enregistrer**.
4. Sélectionnez **Publier** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/TwrLWOmtEE_zyIZg/docs/images/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?fit=max&auto=format&n=TwrLWOmtEE_zyIZg&q=85&s=b2410e6d0856a46d4a88c1e7a191a265" alt="Dashboard > Actions > Forms > Form > nœud Step" data-og-width="1404" width="1404" data-og-height="533" height="533" data-path="docs/images/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/TwrLWOmtEE_zyIZg/docs/images/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=280&fit=max&auto=format&n=TwrLWOmtEE_zyIZg&q=85&s=8daa0c581938c50ef973f4087e96b4f0 280w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/TwrLWOmtEE_zyIZg/docs/images/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=560&fit=max&auto=format&n=TwrLWOmtEE_zyIZg&q=85&s=4955bba2a827f726f136e9e1546f960e 560w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/TwrLWOmtEE_zyIZg/docs/images/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=840&fit=max&auto=format&n=TwrLWOmtEE_zyIZg&q=85&s=9654088bf7e4f6203425280212f10e3a 840w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/TwrLWOmtEE_zyIZg/docs/images/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=1100&fit=max&auto=format&n=TwrLWOmtEE_zyIZg&q=85&s=7c918db142fca286fa5ebf88f8491bbe 1100w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/TwrLWOmtEE_zyIZg/docs/images/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=1650&fit=max&auto=format&n=TwrLWOmtEE_zyIZg&q=85&s=ad0dde6a22687c813b5dccf81d691c39 1650w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/TwrLWOmtEE_zyIZg/docs/images/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=2500&fit=max&auto=format&n=TwrLWOmtEE_zyIZg&q=85&s=32f4ac661c5958ee5d80d7883d890baa 2500w" />
</Frame>

<h3 id="configure-the-flow-node">
  Configurer le nœud de flux
</h3>

Ajoutez un nœud **Flow** après le nœud **Step** pour mettre à jour `user_metadata` et reprendre le flux d’authentification en suivant ces étapes :

1. Sélectionnez **Flow** au bas de l’éditeur de formulaires.
2. Supprimez le lien existant entre les nœuds **Step** et **Ending Screen**.
3. Sélectionnez le nouveau **Flow** > **Click to add a flow** > **Create a new flow.**

   * Saisissez `Update user_metadata` dans le champ **Name**.
   * Sélectionnez **Create**.
   * Sélectionnez **Save**.
4. Reliez le nœud **Flow** aux nœuds **Step** et **Ending Screen**, comme illustré ci-dessous.
5. Sélectionnez **Publish** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/yeB-_kMT57yxnTpV/docs/images/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?fit=max&auto=format&n=yeB-_kMT57yxnTpV&q=85&s=1431fbe46ab56fb1df5143601e7d4507" alt="Dashboard > Actions > Forms > Form" data-og-width="1404" width="1404" data-og-height="540" height="540" data-path="docs/images/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/yeB-_kMT57yxnTpV/docs/images/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=280&fit=max&auto=format&n=yeB-_kMT57yxnTpV&q=85&s=558bf20c99e5ea98d567eca9fa4f7785 280w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/yeB-_kMT57yxnTpV/docs/images/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=560&fit=max&auto=format&n=yeB-_kMT57yxnTpV&q=85&s=9b8a1139d23f83e84302929893506379 560w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/yeB-_kMT57yxnTpV/docs/images/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=840&fit=max&auto=format&n=yeB-_kMT57yxnTpV&q=85&s=a3d5e4b796a1519c211b27f99815479e 840w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/yeB-_kMT57yxnTpV/docs/images/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=1100&fit=max&auto=format&n=yeB-_kMT57yxnTpV&q=85&s=ea87d00ec37114caea67014878b5a005 1100w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/yeB-_kMT57yxnTpV/docs/images/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=1650&fit=max&auto=format&n=yeB-_kMT57yxnTpV&q=85&s=3885e198fa2798e59b2dfd9653e5fd2c 1650w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/yeB-_kMT57yxnTpV/docs/images/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=2500&fit=max&auto=format&n=yeB-_kMT57yxnTpV&q=85&s=1535bd041183a038acf353ae9809e3d7 2500w" />
</Frame>

Ajoutez une action Auth0 **Update user** au flux en suivant ces étapes :

1. Sélectionnez le flux **Update user\_metadata**, puis sélectionnez **Edit Flow** pour ouvrir l’éditeur de flux dans un nouvel onglet.
2. Sous l’action **Start**, sélectionnez l’icône **+** pour ajouter une action **Update user**. Remplissez les champs ci-dessous, puis sélectionnez **Save** pour continuer.

   * **Connection** : Dans la liste déroulante, sélectionnez la connexion Vault de votre application M2M.

   * **User ID** : Saisissez `{{context.user.user_id}}`.

   * **Body** : Copiez-collez le code suivant pour mettre à jour `user_metadata` avec les propriétés `job_title` et `company_name`.

     ```json lines theme={null}
     {
        "user_metadata": {
           "job_title": "{{fields.job_title}}",
           "company_name": "{{fields.company_name}}"
        }
     }
     ```

   * Sélectionnez **Save**.
3. Sélectionnez **Publish** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/92Wt_74aRs6J5W5X/docs/images/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?fit=max&auto=format&n=92Wt_74aRs6J5W5X&q=85&s=dbc401c42ed28203102b62678de45819" alt="Dashboard > Actions > Forms > Flows" data-og-width="1404" width="1404" data-og-height="244" height="244" data-path="docs/images/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/92Wt_74aRs6J5W5X/docs/images/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=280&fit=max&auto=format&n=92Wt_74aRs6J5W5X&q=85&s=75151b3047091844f6e59f77ec3f6281 280w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/92Wt_74aRs6J5W5X/docs/images/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=560&fit=max&auto=format&n=92Wt_74aRs6J5W5X&q=85&s=05dedfd974efea26618bc56e5a483d37 560w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/92Wt_74aRs6J5W5X/docs/images/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=840&fit=max&auto=format&n=92Wt_74aRs6J5W5X&q=85&s=5af0f38bddbc9e14b8c5a31eca5bf0df 840w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/92Wt_74aRs6J5W5X/docs/images/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=1100&fit=max&auto=format&n=92Wt_74aRs6J5W5X&q=85&s=61637c660cf03d37d2d43e52eb2eebf5 1100w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/92Wt_74aRs6J5W5X/docs/images/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=1650&fit=max&auto=format&n=92Wt_74aRs6J5W5X&q=85&s=15458e4affcbf01f0a919a99afe4ab03 1650w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/92Wt_74aRs6J5W5X/docs/images/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=2500&fit=max&auto=format&n=92Wt_74aRs6J5W5X&q=85&s=3f437e9d164a66f10bf92e714e48c3bd 2500w" />
</Frame>

<h3 id="retrieve-the-form-render-code">
  Récupérer le code de rendu du formulaire
</h3>

Récupérez le code de rendu du formulaire pour l’afficher à l’aide d’une Action Post Login personnalisée en suivant ces étapes :

* Dans l’éditeur de formulaires, sélectionnez **`<> Render`**.
* Sélectionnez **Copy**.

<Frame>
  <img src="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/8QDqDsYoCi_WTBFO/docs/images/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?fit=max&auto=format&n=8QDqDsYoCi_WTBFO&q=85&s=741bd11e736604e33d0fb1a59ed78dfe" alt="Dashboard > Actions > Forms > Form > Embed" data-og-width="1400" width="1400" data-og-height="848" height="848" data-path="docs/images/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/8QDqDsYoCi_WTBFO/docs/images/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=280&fit=max&auto=format&n=8QDqDsYoCi_WTBFO&q=85&s=c48e68074ebe20efb4ce43cc8a3cc182 280w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/8QDqDsYoCi_WTBFO/docs/images/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=560&fit=max&auto=format&n=8QDqDsYoCi_WTBFO&q=85&s=6a89ef932ef9f113ab5c2303cf5db408 560w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/8QDqDsYoCi_WTBFO/docs/images/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=840&fit=max&auto=format&n=8QDqDsYoCi_WTBFO&q=85&s=90d6001f103f89f2e67cd24624b6da8d 840w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/8QDqDsYoCi_WTBFO/docs/images/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=1100&fit=max&auto=format&n=8QDqDsYoCi_WTBFO&q=85&s=ad7ba4837d0eb9ed48910c7d4a32c2aa 1100w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/8QDqDsYoCi_WTBFO/docs/images/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=1650&fit=max&auto=format&n=8QDqDsYoCi_WTBFO&q=85&s=43015aed00e4bd000b426e5b7bca1c63 1650w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/8QDqDsYoCi_WTBFO/docs/images/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=2500&fit=max&auto=format&n=8QDqDsYoCi_WTBFO&q=85&s=3c99152e4672f4e458cf5d22ba3bbc81 2500w" />
</Frame>

<h2 id="create-a-post-login-action">
  Créer une Action Post Login
</h2>

Créez une Action post-login pour afficher votre formulaire en suivant ces étapes :

1. Accédez à **Auth0 Dashboard > Actions > Flows > Login.**
2. Sélectionnez l’icône **+**, puis **Build from scratch** :

   * **Name** : Entrez `Render Progressive Profile Form`.
   * **Trigger** : Sélectionnez `Login / Post Login`.
   * **Runtime** : Sélectionnez la version recommandée.
3. Sélectionnez **Create**.

Pour configurer l’Action post-login :

1. Supprimez le code existant dans l’éditeur Code.
2. Collez le code d’intégration du formulaire dans l’éditeur Code.
3. Modifiez le code pour définir la logique conditionnelle qui affichera le formulaire.

   ```javascript lines theme={null}
   /**
   * @param {Event} event - Détails sur l’utilisateur et le contexte dans lequel il se connecte.
   * @param {PostLoginAPI} api - Interface dont les méthodes peuvent être utilisées pour modifier le comportement de la connexion.
   */
   exports.onExecutePostLogin = async (event, api) => {
     const FORM_ID = 'REPLACE_WITH_YOUR_FORM_ID';

     if (
       event.stats.logins_count > 2 &&
       !event.user.user_metadata.company_name &&
       !event.user.user_metadata.job_title
     ) {
       api.prompt.render(FORM_ID);
     }
   }

   exports.onContinuePostLogin = async (event, api) => { }
   ```

   <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
     L’exemple de code ci-dessus affiche le formulaire lorsqu’un utilisateur a un nombre de connexions > 2 et que les propriétés de métadonnées utilisateur company\_name et job\_title sont absentes.
   </Callout>
4. Sélectionnez **Deploy.**
5. Glissez-déposez l’Action **Render Progressive Profile Form** dans le **Login flow**.

   <Frame>
     <img src="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/G9kmP20ll8AiX0Om/docs/images/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?fit=max&auto=format&n=G9kmP20ll8AiX0Om&q=85&s=ba95705dbc6e3c0145f44aefa2676e28" alt="Dashboard > Forms > Use Cases Progressive Profile Login Action" data-og-width="1079" width="1079" data-og-height="524" height="524" data-path="docs/images/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/G9kmP20ll8AiX0Om/docs/images/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=280&fit=max&auto=format&n=G9kmP20ll8AiX0Om&q=85&s=e435a4de47e3b9dec71a95662979a273 280w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/G9kmP20ll8AiX0Om/docs/images/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=560&fit=max&auto=format&n=G9kmP20ll8AiX0Om&q=85&s=140892a32b66d2f1c3f094e515932731 560w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/G9kmP20ll8AiX0Om/docs/images/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=840&fit=max&auto=format&n=G9kmP20ll8AiX0Om&q=85&s=b82775d2afebf047fe398e0481d9f446 840w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/G9kmP20ll8AiX0Om/docs/images/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=1100&fit=max&auto=format&n=G9kmP20ll8AiX0Om&q=85&s=35c1c1176c6bb2637b3986b7576c4db4 1100w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/G9kmP20ll8AiX0Om/docs/images/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=1650&fit=max&auto=format&n=G9kmP20ll8AiX0Om&q=85&s=29fb85a599732a7ff706553475b0d2cd 1650w, https://mintcdn.com/docs-dev-chore-myaccount-api-autoupdate/G9kmP20ll8AiX0Om/docs/images/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=2500&fit=max&auto=format&n=G9kmP20ll8AiX0Om&q=85&s=ec9ef9001a2212342e7d3fabbfd6418a 2500w" />
   </Frame>
6. Sélectionnez **Apply**.

<h3 id="test-implementation">
  Tester la mise en œuvre
</h3>

Testez la mise en œuvre en suivant ces étapes :

1. Connectez-vous avec un utilisateur existant dont le nombre de connexions est supérieur à 2 et dont les attributs `user_metadata` `company_name` et `job_title` sont vides.
2. L’action post-login du Login flow affichera le formulaire et demandera ces renseignements.
3. Sélectionnez **Auth0 Dashboard > User Management > Users,** repérez l’utilisateur et vérifiez que les attributs `user_metadata` `company_name` et `job_title` contiennent bien des renseignements.
