Product Description
Generate a unique id in a hidden gravity form Unique Id Field.
This plugin adds a field button called ‘Unique ID’ to your Gravity Form Advanced Fields group. Add it to your form to automatically include a hidden unique id field with each successful submission.

This plugin is superior to other ways of adding a unique id:
- It populates the unique id when the entry is saved. Therefore, it is
- available in your merge tags
- can be included in email notifications
- can be made available to third parties after submission
- It checks for the unique id generated in any of your forms. Just to make sure it is indeed unique to your website.
The Unique ID Field works out of the box. No modifications are necessary.
The unique id is prefixed with AZ_ but you can change that by adding this code to your functions file:
add_filter( 'az_gf_uid_filter', 'my_function_to_change_prefix'); function my_function_to_change_prefix ($prefix) { return 'XYZ_'; }
(Change XYZ_ to what you would like for your prefix.)
There is a filter to change the entire unique id if you want :
add_filter('az_gf_value_filter','change_value_to_timestamp'); function change_value_to_timestamp($value){ return current_time('timestamp'); // change the unique id to the current timestamp using your WordPress timezone setting }
Geek alert:
This plugin uses PHP’s uniqid function. Read more here: http://php.net/manual/en/function.uniqid.php
Get the value of the unique id after submission by input id if known:
$unique_id = rgar( $entry, ’24’ )
or using GF API if not known.
Example:
$unique_id_fields = GFAPI::get_fields_by_type( $form, [‘az_unique_id’] ); $unique_id = rgar( $entry, $unique_id_fields[0]->id );