# Getting First and Last name during signup

**URL:** <https://community.auth0.com/t/getting-first-and-last-name-during-signup/193201>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [October 15, 2025, 4:22am UTC](https://community.auth0.com/t/getting-first-and-last-name-during-signup/193201 "2025-10-15T04:22:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurt.dunn](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kurt.dunn/32/72021_2.png) [@kurt.dunn](https://community.auth0.com/u/kurt.dunn)\
**Post date:** [October 15, 2025, 4:22am UTC](https://community.auth0.com/t/getting-first-and-last-name-during-signup/193201/1 "2025-10-15T04:22:37Z")

</div>

Hi,

I am after some help please. I am trying to get first and last name during the signup process using the new universal login experience via actions. Is this possible? If not, whats easiest way to achieve it?

```auto
exports.onExecutePreUserRegistration = async (event, api) => {
  // Check if the form has been submitted and data is present.
  if (event.forms?.data?.given_name && event.forms?.data?.family_name) {
    const { given_name, family_name } = event.forms.data;
    api.user.setUserMetadata("firstName", given_name);
    // Use the same key 'lastName' for consistency.
    api.user.setUserMetadata("lastName", family_name);
    return;
  }

  // Check if the names are already present from another source.
  if (!event.user.user_metadata?.given_name && !event.user.user_metadata?.family_name) {
    // Trigger a form to ask for the extra info.

    api.forms.requestData({
      title: "Tell us a bit about yourself",
      description: "Please provide your first and last name to complete your registration.",
      fields: [
        {
          key: "given_name",
          label: "First Name",
          type: "text",
          required: true,
        },
        {
          key: "family_name",
          label: "Last Name",
          type: "text",
          required: true,
        },
      ],
    });
  }
};

```

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [October 15, 2025, 8:19pm UTC](https://community.auth0.com/t/getting-first-and-last-name-during-signup/193201/4 "2025-10-15T20:19:52Z")

</div>

Hi @kurt.dunn

Welcome back to the Auth0 Community!

Regarding adding additional data to the user profile, there are 2 approaches that I would recommend:

- Customize the partials for the signup prompt of your Universal Login in order to contain additional fields for First and Last name. There is a good example available in our documentation right [here](https://auth0.com/docs/customize/login-pages/universal-login/customize-signup-and-login-prompts#save-to-user-metadata).
- Render a form on an user’s first login in order to collect this data and add it to their profile. An example of such a form would be:  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/3/e/3eb80ac0cb35905021ee8ef09006520579b743eb.png)  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/e/8/e8ddc762835b9e8b13ebe13a14dceb48d1d9f1a6.png)

If you have any other questions, let me know!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![kurt.dunn](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kurt.dunn/32/72021_2.png) [@kurt.dunn](https://community.auth0.com/u/kurt.dunn)\
**Post date:** [October 15, 2025, 11:12pm UTC](https://community.auth0.com/t/getting-first-and-last-name-during-signup/193201/5 "2025-10-15T23:12:48Z")

</div>

> [@nik.baleca](#):
>
> Customize the partials for the signup prompt

Hi Nik,

Ive added the partial to the sign up form via the api as I need to capture this detail here and not later.

 ![Screenshot 2025-10-16 at 10.08.15 am](https://global.discourse-cdn.com/auth0/original/3X/1/4/14a154867d6adb56b152b24028cd54dd9a4ae3aa.png)

The trouble now is when i use Database \> Try I can see the rendered partial as expected.

But when i login via my app the partials do not render.

Any ideas?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [November 12, 2025, 7:43pm UTC](https://community.auth0.com/t/getting-first-and-last-name-during-signup/193201/6 "2025-11-12T19:43:46Z")

</div>

Hi again @kurt.dunn

Sorry for not replying back to the issue at hand.

Do you still experience the issue mentioned above or did you manage to have the partials render properly? Please take into account that you must have a [Custom Domain](https://auth0.com/docs/customize/custom-domains) configured in order to customize the partials for certain prompts. That might explain why the **Try** button shows the proper partials but the actual Universal Login does not.

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 26, 2025, 7:44pm UTC](https://community.auth0.com/t/getting-first-and-last-name-during-signup/193201/7 "2025-11-26T19:44:43Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
