What does it do?
This plugin provides a new Unique ID field type which generates a unique ID for the entry when submitted. Some common uses for this perk are:
- Provide a set-length confirmation or reference number for each entry; could be displayed on the confirmation page and in notifications (i.e. “Your confirmation number is ABC142Z3”).
- Maintain a sequential invoice number (a legal requirement for some countries)
- Generate a unique coupon code that can be used on subsequent form submissions (tutorial coming soon!)
- Generate a unique number for use in raffles
There are probably a hundred other ways this could be used. We would really love to hear how you’re using it!
Features
- Generate unique IDs on form submission.
Every form entry is assigned a unique ID. - Supports alphanumeric, numeric, and sequential numbering.
Select the unique ID type that fits best. - Specify starting number, length, prefix, and suffix.
Customize ID generation to your specific use case. - Merge tag support.
Display Unique ID in form Confirmations, Notifications, and more! - Automatic updates.
Get updates and latest features right in your dashboard. - Awesome support.
We’re here to help! And we mean it.
Documentation
How do I enable this functionality?
After installing and activating Gravity Forms Unique ID, you’ll want to add a Unique ID field to your form. Let’s step through that process.
![]() |
Create a new Form or navigate to any existing Form. Find the Unique ID button under the Advanced Fields group. Click it to add the field to your form. |
![]() |
Modify the field settings as needed. See below for full details on the available field settings. |
That’s it! Your form now has a Unique ID field that will automatically generate a unique ID when the form is submitted.
Feature Details
How does it work?
When a form containing a Unique ID field is submitted, a unique ID is generated and populated for this field. The ID is unique to the form and field.
Field Settings
General Settings
Field Label
The label of the field. Visible in the {all_fields}
merge tag and on the entry detail and entry list views.
Type
The type of unique ID that will be generated for this field.
- Alphanumeric
Contains letters and numbers (i.e.a12z9
). - Numeric
Contains only numbers (i.e.152315902
). - Sequential
Contains only numbers and is sequential with previously generated IDs per field (i.e.1
,2
,3
).
Advanced Settings
Starting Number
Set the starting number for sequential IDs; only available when “Sequential” type is selected.
Length
Set a specific length for the generated ID (excluding the prefix and suffix) or leave empty to use default length. There are some differences in length requirements for each ID type.
- Alphanumeric
Requires a minimum length of4
. - Numeric
Requires a minimum length of9
and a maximum length of19
. - Sequential
Length is used to pad the number with zeros (i.e. an ID of1
with a length of5
would be00001
). There is no minimum length.
Prefix
Prepend a short string to the beginning of the generated ID (i.e. abc123890678
). You can use merge tags; the list is available via the “Merge Tags” icon located on the right of the field.
Suffix
Append a short string to the end of the generated ID (i.e. 123890678xyz
). You can use merge tags; the list is available via the “Merge Tags” icon located on the right of the field.
Display the Generated Unique ID
You can display the unique ID generated for any unique ID field using the merge tag for that field. This will be available in the Gravity Forms’ default merge tag lists.
Unique ID fields are automatically included in Gravity Forms {all_fields}
merge tag.
Integrations
Gravity Forms File Renamer
File Renamer can automatically rename files uploaded to Gravity Forms and it integrates seamlessly with Unique ID. Create flexible naming templates with static or dynamic values, automatically create new subfolders on upload, and control when files are incremented or how they’re deduplicated.
With Unique ID, filenames can be given sequential numbers and unique alphanumeric IDs. Simply insert the Unique ID field’s merge tag into the File Template — no additional configuration required.
FAQs
Can Unique ID generation be delayed until after payment is approved?
If your form uses a first-party payment add-on (or a third-party payment add-on compatible with the Gravity Forms Payment Add-On Framework) then the unique ID can be generated once payment has been captured. This delay is enabled via the gpui_wait_for_payment filter.
Can I use a Unique ID as a username for the Gravity Forms User Registration Add-On?
Normally, the User Registration Add-On will throw a validation error since validation happens before the unique ID is generated. Use the following snippet to bypass the validation when a Unique ID field is configured for the username.
I added a Unique ID field to an existing form. Can I retroactively populate Unique IDs for previous entries?
You sure can! Use the following snippet to retroactively populate Unique ID fields. To use it, go to your home page and add the following parameters to the query string:
gpui_retro_pop=1&form_id=123
Make sure to replace 123
with your Form ID. The full URL will look like this:
https://mysite.com/?gpui_retro_pop=1&form_id=123
After the URL is submitted, you’ll be greeted with a success message and updated entry count.
Hooks
- gpui_form_editor_field_settings
- gpui_numeric_minimum_length
- gpui_sequential_unique_id_pre_insert
- gpui_unique_id
- gpui_unique_id_attributes
- gpui_wait_for_payment