September 21st, 2021: Fixed a compatibility issue with GP Inventory.
July 21st, 2021: Added support for bypassing Limit Submissions feeds when an entry is being edited.
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' => 179, // Set this to the form ID 'delete_partial' => false, // Set this to true to delete partial entries if enabled ) );
The snippet supports Partial Entries. Set
true to automatically delete any lingering partial entries when the updated entry is submitted.
Limit Submissions Integration
This snippet integrates with GF Limit Submissions to automatically bypass feeds when editing an entry. This is useful in a variety of scenarios, such as:
- An art contest where a user can only submit a single piece, but is allowed to edit it until the submission deadline.
- Adoption applications in which the user can apply to adopt up to 2 animals and can update their application at any time.
- Community-center classifieds where the user can list up to 3 items, but can update their listings until the items are sold.
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.