Adding a Unique ID to Each Form Submission

Each form submission in Convert Forms already has a built-in unique ID. This is a sequential number (e.g. 1, 2, 3…) that serves as the primary key for identifying each entry in the system.

While this built-in ID is perfectly fine for internal use, there are situations where you may want to generate a different type of identifier—one that’s random, less predictable, or formatted differently. For example, you might want to display a custom reference number to users after they submit a form, such as an order confirmation code or a case number. A custom ID can also be useful when syncing data with third-party systems that require a specific token format or when you don’t want users to guess the number of submissions your form has received.

Thankfully, you can generate a unique reference number for each submission using Convert Forms—without writing a single line of code.

Add a Hidden Field to Your Form

Edit your form and add a Hidden field. Give it a name such as unique_id.

add randomid to submission

Then, in the Default Value setting, insert the following Smart Tag:

{randomid}

The Random ID Smart Tag creates a random 8-character token for each submission and stores it in this hidden field. Example: 03bc431d0d605ce4.

Hidden fields are not visible inside the form to your visitors, but we’re using this field to store the unique ID for internal reference so that it will display on the entry.

If your site uses aggressive browser, server, or plugin-level caching, there’s a small chance that duplicate random IDs could occur. If you need guaranteed uniqueness, you may need to implement server-side validation or use a different approach

Adding the Unique ID to Email Messages

To include the unique ID in your email notifications, use the Smart Tag for the hidden field. If your field is named unique_id, use:

{field.unique_id}

This will output the random ID in your email message, making it easy to reference in communications with users or backend workflows.

Last updated on Apr 16th 2025 15:04