# Advanced Registration Form Reference

Reference for advanced registration form fields, validation, form rules, consents, localization, and edge cases such as required fields added later.

> For the index of this section of the site, see [llms.txt](https://fusionauth.io/docs/llms.txt)

The Admin UI manages Form Fields on Customizations -> Form Fields and forms on Customizations -> Forms . For how advanced registration forms work, see [Advanced Registration Forms](https://fusionauth.io/docs/users/register/advanced-registration-forms.md).

## Form Fields and Validation

FusionAuth validates each step of an advanced registration form when the user submits the step. A validation failure keeps the user on the current step. The theme controls where and how the error messages appear. FusionAuth runs the validation on the server, and some controls add native browser validation. To validate in the browser, add JavaScript to the login templates of the theme. For every check and error code, see [User Data Validation](https://fusionauth.io/docs/users/user-data-validation.md#custom-form-fields).

### Form Field Settings

`Id`

*   Optional

A UUID for the Form Field. When you leave out the Id, FusionAuth generates one. You can't change the Id after you create the Form Field.

`Name`

*   Required

The name of the Form Field. The Admin UI shows the name. Users see the label from the theme messages instead.

`Field`

*   Required
*   Immutable

The key that stores the value. Choose a standard key, such as `Email (user.email)`, or one of the following custom options:

*   `Custom user data (user.data.*)` stores the value in **`user.data`**.
*   `Custom registration data (registration.data.*)` stores the value in **`registration.data`**.
*   `Self consent` lets the user consent to a [Consent](https://fusionauth.io/docs/apis/consents.md) during registration.

For a custom option, enter the rest of the key, such as `minprice` for `registration.data.minprice`. A key must be unique within the **`data`** object.

`Consent`

*   Optional
*   Immutable

The Consent that the field represents. This field is required when **Field** is set to `Self consent`.

`Form control`

*   Optional
*   Immutable

The HTML control that renders the field. The values are `Text`, `Password`, `Checkbox`, `Number`, `Radio`, `Select`, and `Textarea`. When a control offers a fixed set of options, such as `Radio` or `Select`, the user must choose one of the options.

`Data type`

*   Optional
*   Immutable

The type that FusionAuth stores the value as. The values are `String`, `Email`, `Phone`, `Number`, `Date`, and `Boolean`. A value that doesn't convert to the data type fails validation. For example, a non-numeric value in a `Number` field returns an error.

`Options`

*   Optional

The options of a `Checkbox`, `Radio`, or `Select` control, one per line. Each option must convert to the data type. FusionAuth shows the options in the order you enter them, and translates an option when the theme messages have a key for the option. This field is required for those controls, except on standard fields such as `registration.roles`, which get options from FusionAuth.

`Required`

*   Optional
*   Defaults to `false`

Whether the user must enter a valid value. When **Required** is off, an empty value is valid.

`Confirm value`

*   Optional
*   Defaults to `false`

Whether the user must enter the value twice. FusionAuth adds a second input with the same data type and control, below the first input. The step fails validation when the values differ. You can move the second input in the theme.

`Validation`

*   Optional
*   Defaults to `false`

Whether FusionAuth checks the value against **Expression**.

`Expression`

*   Optional

A [Java regular expression](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html) that the value must match. The expression must match the whole value, so `[0-9]+` rejects `abc123`. This field is required when **Validation** is on.

For the same settings in the API, see the [Form Fields API](https://fusionauth.io/docs/apis/custom-forms/form-fields.md).

### Custom Form Fields

A custom Form Field stores a value under **`user.data`** or **`registration.data`**. Use **`user.data`** for data that several Applications share, and **`registration.data`** for data that one Application uses. For more information, see [Where FusionAuth Stores the Data](https://fusionauth.io/docs/users/register/advanced-registration-forms.md#where-fusionauth-stores-the-data).

A theme message with the same key as the field sets the label and placeholder of the field. For more information, see [Theme an Advanced Registration Form](https://fusionauth.io/docs/users/register/advanced-registration-forms/theme.md).

### Lambda Validation

To run more complex checks on a registration, set **Self-service registration validation lambda** on the Registration tab of the Application. When your plan includes HTTP Lambda Connect, the lambda can call external APIs with `fetch`. For more information, see [Self-Service Registration Validation Lambda](https://fusionauth.io/docs/lambdas/login/self-service-registration.md).

## Form Rules

A form has a **Type** of `Registration`, `Admin Registration`, `Admin User`, or `Self-service User`. Advanced registration forms use `Registration`. For the admin types, see [Custom Admin Forms](https://fusionauth.io/docs/users/admin-forms.md).

FusionAuth checks the following rules when you save a registration form:

*   The form has at least one step.
*   One step contains an email, phone number, or username field, and the field is required.
*   A field appears only once in the form.
*   A verification step contains no fields.
*   A form has at most one verification step of each type.
*   The `user.email` field appears before an **Email Verification** step, and the `user.phoneNumber` field appears before a **Phone Verification** step.
*   The password field appears after every verification step.

Each step that collects data needs at least one field.

## Consents

To add a Consent to a form, create a Form Field with **Field** set to `Self consent`, and choose the Consent. FusionAuth sets the control from the Consent. A Consent with no values, or with multiple values allowed, renders as a checkbox. A Consent with values that allows only one value renders as radio buttons. For more information, see the [Consents API](https://fusionauth.io/docs/apis/consents.md).

FusionAuth names the field after the Consent Id, such as `consents['dd35541d-e725-4487-adba-5edbd3680fb8']`. To add a label for the Consent, add a line with that name to the theme messages:

```properties
consents['dd35541d-e725-4487-adba-5edbd3680fb8']=I consent to sharing my data with affiliated companies
```

## Email Localization

FusionAuth localizes emails in the preferred languages of the user. When a registration form sets **`user.preferredLanguages`**, FusionAuth localizes the first emails, such as the password setup email or the email verification email. For more information, see [Localization and Internationalization](https://fusionauth.io/docs/concepts/localization-and-internationalization.md).

To let the user choose a language, add the standard `Preferred languages` Form Field to the form:

![The form editor with a preferred language field on a registration step.](https://fusionauth.io/img/docs/screenshots/register-setup-locale-selection.png)

The default theme renders **`user.preferredLanguages`** as a select box with every supported locale, and ignores the **Options** of the field. To offer fewer locales, change the `locale_select` macro in the theme Helpers. To set the language without a select box, render the field as a hidden field and set the value with JavaScript. For more information, see [Add a Hidden Field](https://fusionauth.io/docs/users/register/advanced-registration-forms/theme.md#add-a-hidden-field).

## Manage Forms With the API

The [Form Fields API](https://fusionauth.io/docs/apis/custom-forms/form-fields.md) and the [Forms API](https://fusionauth.io/docs/apis/custom-forms/forms.md) manage advanced registration forms. Use the APIs to copy form configuration between environments, or to create registration forms for new Applications.

For example, a private-labeled application can let an administrator choose the required registration fields without access to the Admin UI. A custom interface calls the FusionAuth APIs to build the form and associate the form with the Application.

## Special Considerations

### Pre-verification

Available since `1.62.0`

An advanced registration form can verify an email address or a phone number before FusionAuth creates the user. For more information, see [Email Identity Pre-Verification](https://fusionauth.io/docs/users/verify/identity-pre-verification-using-email.md) and [Phone Identity Pre-Verification](https://fusionauth.io/docs/users/verify/identity-pre-verification-using-phone.md).

### Searching on User Data

When you use the Elasticsearch search engine, FusionAuth indexes all data in **`registration.data`** and **`user.data`**. Search the values with the [User Search API](https://fusionauth.io/docs/apis/users/search.md).

The following Elasticsearch query finds the users with a `minprice` value between 50000 and 100000:

Example JSON for the query parameter to search for users with a given house hunting price range

```json
{
  "bool": {
    "must": [
      {
        "nested": {
          "path": "registrations",
          "query": {
            "range": {
              "registrations.data.minprice": {
                "gte": 50000,
                "lte": 100000
              }
            }
          }
        }
      }
    ]
  }
}
```

### Adding Required Fields Later

With self-service registration on, FusionAuth checks that the Registration is complete each time a user logs in through the hosted login pages. The check happens after the authorize request and before the redirect.

When you add a required field to the registration form after users register, FusionAuth sends each of those users to the form at the next hosted login. The user fills out the missing field. FusionAuth renders the form with the **OAuth complete registration** template.

When a user logs in with a single sign-on method, such as Google or SAML, without every required field, FusionAuth also sends the user to the registration form. To skip the form for Identity Provider logins, set every required field in the reconcile lambda of the Identity Provider.

Note

FusionAuth ignores **Email Verification** and **Phone Verification** steps when an existing user completes a registration. Gating enforces verification for existing users. For more information, see [Gate Users Until They Verify Their Email](https://fusionauth.io/docs/users/verify/gate-accounts-until-user-email-verified.md) and [Gate Users Until They Verify Their Phone Number](https://fusionauth.io/docs/users/verify/gate-accounts-until-user-phone-verified.md).

### Modifying an Existing Form Field

You can't change the **Field**, **Consent**, **Form control**, or **Data type** of a saved Form Field. You can change the other settings.

To change one of those settings, duplicate the Form Field, change the duplicate, and update the form to use the duplicate. FusionAuth doesn't delete a Form Field that a form still uses. For example, to show the minimum price as a select box instead of a number input, duplicate the minimum price field, change the control, and replace the field in the form.

Caution

When you use Elasticsearch, a new data type for the same key in **`registration.data`** or **`user.data`** can conflict with the existing index and require manual index updates. When you must change the data type of a Form Field, use a new key.

### Registration With Other Identity Providers

When an Application allows registration with an external Identity Provider, such as Facebook or Active Directory, FusionAuth sends the user into the registration form after the Identity Provider returns.

For example, a form has optional fields in the first step and required fields in the second step. A user registers with Facebook. FusionAuth sends the user to the second step, and the user completes the form from the second step onward.

### Self-Service Registration and Registrations

When an Application has **Registration mode** set to `Create registration`, a user without a [Registration](https://fusionauth.io/docs/concepts/types/registrations.md) for the Application can log in through the [hosted login pages](https://fusionauth.io/docs/concepts/integration-points.md#hosted-login-pages). FusionAuth creates the Registration during the login and assigns the default roles of the Application.

Self-service registration applies only to the hosted login pages. The following logins don't create a Registration, even when **Registration mode** is `Create registration`:

*   A login with the [Login API](https://fusionauth.io/docs/apis/login.md). The Login API returns a `202` status code and no refresh token.
*   A login with the [Password Grant](https://fusionauth.io/docs/authentication/oauth/legacy-grants.md#password-grant). FusionAuth returns tokens, but the user stays unregistered. For more information, see [Users Without a Registration](https://fusionauth.io/docs/authentication/oauth/legacy-grants.md#users-without-a-registration).

To register a user who logs in with an API, create the Registration from your server with the [Registrations API](https://fusionauth.io/docs/apis/registrations/create-a-user-registration-for-an-existing-user.md). For more information, see [Register a User and Log In](https://fusionauth.io/docs/users/register/register-user-login-api.md).

A login through an [Identity Provider](https://fusionauth.io/docs/authentication/identity-providers.md) can also create a Registration. When **Create registration** is on for the Application in the Identity Provider, FusionAuth creates the Registration for both hosted and API logins, with any **Registration mode**. When **Create registration** is off, only a hosted login to an Application in `Create registration` mode creates the Registration. For more information, see [Applications and Overrides](https://fusionauth.io/docs/authentication/identity-providers/applications-and-overrides.md).

For example, a Tenant has the following Applications:

*   Pied Piper Video Chat, with **Registration mode** set to `Create registration`
*   Pied Piper Email Service, with self-service registration disabled

The user `richard@piedpiper.com` has an account in the Tenant, with no Registration for either Application. Richard logs in to Pied Piper Video Chat through the hosted login pages. FusionAuth creates a Registration for Pied Piper Video Chat. The access token contains the **`applicationId`** claim and the default roles.

Richard then logs in to Pied Piper Email Service. The login succeeds, because Richard has an account in the Tenant. FusionAuth creates no Registration, so the access token contains no roles and no **`applicationId`** claim.

For more information, see [Authentication and Authorization](https://fusionauth.io/docs/concepts/authentication-authorization.md).

### Admin UI Forms

Form Fields also build the forms that the Admin UI uses to add and edit users and registrations. For more information, see [Custom Admin Forms](https://fusionauth.io/docs/users/admin-forms.md).

Related

[Users Build an Advanced Registration Form Learn how to build a two-step advanced registration form with custom fields, register a user, and read the custom data with the API. advanced registration formsform fieldsregistration data](https://fusionauth.io/docs/users/register/advanced-registration-forms/tutorial.md)

[Users Advanced Registration Forms Learn about advanced registration forms, which collect custom profile data over one or more steps during self-service registration. advanced registration formsself-service registration](https://fusionauth.io/docs/users/register/advanced-registration-forms.md)

[APIs Form API Learn about the APIs for creating, retrieving, updating and deleting forms. form fields](https://fusionauth.io/docs/apis/custom-forms/forms.md)

[APIs Register API API documentation for the FusionAuth Register OAuth2 endpoint, which starts self-service user registration on the hosted pages. self-service registration](https://fusionauth.io/docs/apis/oauth/register.md)
---

## Other pages in Advanced Registration Forms

> For the full index of this section, see [Users](https://fusionauth.io/docs/llms-users.txt).

- [Advanced Registration Forms](https://fusionauth.io/docs/users/register/advanced-registration-forms.md): Learn about advanced registration forms, which collect custom profile data over one or more steps during self-service registration.
- [Theme an Advanced Registration Form](https://fusionauth.io/docs/users/register/advanced-registration-forms/theme.md): Learn how to add labels, placeholders, error messages, and hidden fields to an advanced registration form with a custom theme.
- [Build an Advanced Registration Form](https://fusionauth.io/docs/users/register/advanced-registration-forms/tutorial.md): Learn how to build a two-step advanced registration form with custom fields, register a user, and read the custom data with the API.
