I was adding some functionality to a client’s website so visitors can purchase tickets to a yearly event. To do this, I used Gravity Forms and the Stripe Add-on.
The Notification sent to the buyer had almost all the necessary fields we wanted. But, there’s no native functionality to have a ticket number or unique ID for each entry.
I did some researching and found a genius answer from David over at Gravity Help.
What this code snippet does is use a Hidden Field (Advanced Tab Field). The script then puts your prefix if you’ve added one, along with a unique ID. This worked great to cross-reference during visitor check-in.
- In the Parameter Name of your Hidden Field, type uuid.
- Change the prefix on line 6 of the code snippet to what you’d like it to be
- Change the Form ID on line 21 of the code snippet to your form
- Change the Field ID on line 22 of the code snippet to the ID of the Hidden Field
Once you include the code snippet in your functions.php file, go to your form Notifications area and make sure you’re including the Hidden Field in your email. By default, Gravity Forms will display all fields within the notification.
Don’t Wanna Touch Any Code?
David from gravitywiz.com has written a WordPress Plugin called GP Unique ID. With this plugin, you get a new Gravity Forms field type within the Form Editor and you can specify the type of unique ID, even including sequential IDs, without having to touch any code.