Skip to main content
Version: 1.28 (Current)

User Registration

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens, Users

Creates a new user account on the current site. You give it an email, a username (or use the email as the username), a password (or let it generate one), and optionally a first and last name.

After the account is created, the [NewUserId] token holds the new user's ID, and the [User:*] tokens refer to the new user in the actions that follow. The action doesn't sign the user in. Add a User Login after it if you want that.

Typical Use Cases​

  • Build a custom registration form
  • Add users from an admin screen, for example a listing of pending sign-ups
  • Create an account with a random password and email the details to the user
  • Create accounts that stay unauthorized until the user verifies their email or an admin approves them

Don't use it to​

Action NameDescription
User LoginSigns the new user in.
Update User ProfileSaves more profile properties for the new user.
Grant User RoleAdds the new user to a role.
Authorize UserAuthorizes an account later, for example after email verification.
Load UserLoads a user and makes them the current user for the actions that follow.
Send EmailSends your own welcome or verification email.
Send User Reset Password EmailLets the user set their own password, for example after a random one.

Input Parameter Reference​

In forms and listings, most parameters let you pick a field. You can also switch to an expression and use a token.

ParameterDescriptionSupports TokensDefaultRequired
UsernameThe username for the new account. Ignored when Register with email is on. If it's empty, the action looks for a username field or a [username] token.Yesempty stringYes, unless Register with email is on
Register with emailWhen on, the email is used as the username.NofalseNo
PasswordThe password for the new account. Ignored when Generate random password is on. If it's empty, the action looks for a password confirmation field, a password field, or a [password] token.Yesempty stringYes, unless Generate random password is on
Generate random passwordWhen on, the action generates a password and saves it in the [RegRandomPass] token, for example to send it by email.NofalseNo
EmailThe email for the new account. If it's empty, the action looks for an email field or an [email] token. It must match the site's email format.Yesempty stringYes
First NameThe first name. If it's empty, the action uses the [FirstName] token, if there is one.Yesempty stringNo
Last NameThe last name. If it's empty, the action uses the [LastName] token, if there is one.Yesempty stringNo
Send standard registration emailWhen on, the site's standard registration email is sent to the new user. The type of email depends on Authorize users who register with this form. Only sent from forms and listings. Not shown in Automation.NofalseNo
Authorize users who register with this formWhether the new account is authorized (approved) and can sign in. See Authorization.NoAuthorizeNo

Output Parameters Reference​

TokenDescription
[NewUserId]The ID of the new user.
[RegRandomPass]The generated password. Only set when Generate random password is on.
[User:*]After the action, these tokens refer to the new user, for example [User:UserID] or [User:Email].

Authorization​

OptionAccountStandard email sent
AuthorizeAuthorized. The user can sign in straight away.The public registration (welcome) email.
Don't AuthorizeNot authorized. The user can't sign in until the account is authorized.The verified registration email, which asks the user to verify their email.
Inherit DNN SettingsFollows the site's User Registration setting. Only Public registration authorizes the account.The email that matches the site setting: private, public or verified registration.

The site's registration setting doesn't stop the action. It creates the account even if the site is set to no registration.

The account that's created​

  • Username: from Username, or the email with Register with email.
  • Display name: first name and last name, separated by a space.
  • Email: set on the account and the Email profile property.
  • Password: must meet the site's password rules, such as minimum length.

If the account can't be created, the action fails with the site's message. Common reasons:

  • The username is already taken.
  • The email is already used and the site requires unique emails.
  • The password doesn't meet the password rules.

Other errors:

ErrorCause
Could not determine email field needed to create new user account!No email was found.
Could not determine username field needed to create new user account!No username was found and Register with email is off.
Could not determine password field needed to create new user account!No password was found and Generate random password is off.
The username does not meet the required format.The email doesn't match the site's email format. The message says "username" even when it's the email that's wrong.

Considerations​

  • An email is always required, even when you set a username.
  • The user isn't signed in. Add User Login after this action. If you leave its Username and Password empty, it picks up the email (with Register with email) and [RegRandomPass] from this action.
  • The current user changes. After this action, [User:*] tokens refer to the new user, not the person who submitted the form. If an admin creates users from a screen, read the admin's details before this action.
  • Standard email only in forms and listings. Send standard registration email does nothing in API endpoints and workflows. Use Send Email there.
  • Treat [RegRandomPass] carefully. Don't show it on the page or write it to logs. Consider sending a reset link with Send User Reset Password Email instead.
  • Protect public registration forms. Anyone who can submit the form can create an account. Limit who can reach the form, or create unauthorized accounts and approve them later.
  • Show a friendly message for duplicates. The action fails if the username is taken. Catch the error with Execute Actions and show your own message.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Register with email and password​

This action creates an authorized account that uses the email as the username. It takes the values from the Email, Password, FirstName and LastName fields, and sends the site's welcome email.

{
"Title": "User Registration",
"ActionType": "UserManagement_UserRegistration",
"Description": "Create the account from the registration form",
"Parameters": {
"RegisterWithEmail": true,
"PasswordField": "[Password]",
"RandomPass": false,
"EmailField": "[Email]",
"FirstName": "[FirstName]",
"LastName": "[LastName]",
"SendDnnMail": true,
"Authorization": "Authorize"
}
}

2. Create an unauthorized account with a random password​

This action creates an account that can't sign in yet, with a generated password. Later actions can send a verification email with Send Email and authorize the account with Authorize User once it's verified.

{
"Title": "User Registration",
"ActionType": "UserManagement_UserRegistration",
"Description": "Create a pending account",
"Parameters": {
"UsernameField": "[Username]",
"RegisterWithEmail": false,
"RandomPass": true,
"EmailField": "[Email]",
"FirstName": "[FirstName]",
"LastName": "[LastName]",
"SendDnnMail": false,
"Authorization": "NoAuthorize"
}
}

Revised 09/28/2026