A User ID field stores a logged-in user's ID number when they fill out a form. It helps connect submitted entries to users on your site. The field is not visible in a front-end form.
Please note that a user ID field saves the user's ID number, but it displays their username in your form's Entries tab, email notification, or View by default. If you would like to display another value from a user's profile, such as first or last name, in an email notification or View, please continue reading here.
Field options
A User ID field has the following options:
Default values and field icons
At times it is useful to automatically populate a user ID field with a pre-defined ID number. If you would like to set a static user ID value to automatically connect entries to a specific user, you may insert a user's ID number in the field's Dynamic Default Value box. Learn more about how to set default values.
Field action icons allow you to duplicate, delete, and/or move a field on the form builder page. See field action icons for more information.
Display User ID fields
Even though a User ID field is hidden, you can still display data from the field in a form's confirmation message, email, or View.
- Username: Display the username for the saved ID number.
[x]
Replace x with the ID or key of the User ID field.
- User ID: Display the user's ID number.
[x show="ID"]
Replace x with the ID or key of the User ID field.
- First name: Display the user's first name.
[x show="first_name"]
Replace x with the ID or key of the User ID field.
- Last name: Display the user's last name.
[x show="last_name"]
Replace x with the ID or key of the User ID field.
- Display name: Show the user's display name.
[x show="display_name"]
Replace x with the ID or key of the User ID field.
- User login: Display the user's username/login.
[x show="user_login"]
Replace x with the ID or key of the User ID field.
- Email: Show the user's email address.
[x show="user_email"]
Replace x with the ID or key of the User ID field.
- Author Link: Show the user's author link. This is the link that will show all of the posts created by the user.
[x show="author_link"]
Replace x with the ID or key of the User ID field.
- Avatar: Display the user's avatar, if they have one. If they don't have one, it will show the default WordPress profile picture. Use the size parameter to determine the width of the displayed image.
[x show="avatar" size="250"]
Replace x with the ID or key of the User ID field.
- Website: Show the user's website from the WordPress profile page.
[x show="user_url"]
Replace x with the ID or key of the User ID field.
- Role: Show the user's role on the site.
[x show="roles"]
Replace x with the ID or key of the User ID field.
- Blank: By default, [x show="first_name"] or [x show="last_name"] will show the user's login if they do not have a first or last name attached to their profile. Use blank="1" to prevent the login from showing.
[x show="first_name" blank="1"]
Replace x with the ID or key of the User ID field.
- User meta: Display any user meta you have added with the User Registration addon or with any other plugin.
[x show="address"]
Replace x with the ID or key of the User ID field. You must replace address with the name of your user meta.
The UserID shortcode options can also be found in the Advanced section of the Customization panel which is located in the right sidebar when you are in your form Settings or a View.
Create view for current user
If you would like to create a View that displays a logged-in user's entries, read how to create a View for the current user.
Search by User ID
If you would like to create a custom search form that searches by user ID, read how to search by User ID.
Related developer hooks
- Make all userID fields appear as dropdowns on the front-end for administrators with the frm_setup_new_fields_vars hook.