June 7th, 2022: Added support for generating a new Easy Passthrough token after an entry has been updated (via the new
January 17th, 2022: Improved compatibility with Gravity Forms Limit Submissions.
April 8th, 2021: Migrated to Snippet Library. Added support for deleting Partial Entries.
If you have ever filled out a form anywhere on the web, you’ve probably wanted an easy way to edit the entry. It’s easy to skip a field, typo a postal code, or worse. Have you ever submitted a form with your own name misspelled? I have. It’s embarrassing.
The most common reason most forms don’t offer an edit option is that it’s complicated. Forms are typically designed for a simple task: capture user input one time. They often lack the capability to retrieve a previous entry, let alone make edits to that entry.
We’re going to show you an easy way to add that capability to any of your Gravity Forms with GF Easy Passthrough.
Using the Snippet
Step 1 – Set Up an Easy Passthrough Feed
Navigate to the form’s Settings and click on Easy Passthrough to set up an Easy Passthrough feed.
Set the form as its own Source Form. All of the standard fields will automatically map because the source form and target form are the same form.
Step 2 – Configure the Snippet
Gravity Forms doesn’t include a built-in way to edit entries on the front end. This simple snippet will grab the last submitted entry ID (via Easy Passthrough) and use that to update the entry when the form is submitted.
To use it, update the
form_id to your form’s ID.
new GPEP_Edit_Entry( array( 'form_id' => 123, // Set this to the form ID 'delete_partial' => false, // Set this to true to delete partial entries if enabled 'refresh_token' => true, // Set this to true to generate a fresh Easy Passthrough token after updating an entry. ) );
The snippet supports Partial Entries. Set
true to automatically delete any lingering partial entries when the updated entry is submitted.
If you would like to use Easy Passthrough tokens as a one-time password for editing entries, set the
refresh_token parameter to
true. When the entry is edited, the token will be regenerated and the entry will be cleared from the session.
If a visitor submits a form and navigates back to the form, Easy Passthrough will automatically pre-populate all of the form’s fields with the previous entry. Then, thanks to the snippet, the existing entry will be updated instead of creating a new entry.
Easy Passthrough uses a session cookie to pass data from one form to another. If that cookie is expired, it will not pass any data.
Help Us Take it Further
This is designed to work as simply as possible but there is a lot we could do from here. Tell us how you’d want to use this. We’ll collect your feedback and improve the functionality over time.