Unique Id Field for Gravity Forms

$10.00

This plugin adds a button called ‘Unique ID’ to your Gravity Form Advanced Fields group. Add it to your form to automatically include a unique id with each successful submission.

SKU: gf-unique-id Categories: , ,

Description

Generate a unique id in a hidden gravity form Unique Id Field.

This plugin adds a 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.

Not only does it generate the unique id it also checks to make sure it does not appear elsewhere in your Gravity Forms Lead Detail table Value field (including a unique id generated from another form). Just to make sure. I mean the odds are beyond slim, but just in case…

 

The Unique ID Field 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 (added in 1.1):

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 unque 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 );

Version 1.1
Compatible with GF 1.9 and later at least (maybe earlier just not tested)
Works with WordPress 5.x