June 7th, 2022: Added support for generating a new Easy Passthrough token after an entry has been updated (via the new
refresh_token
parameter).January 17th, 2022: Improved compatibility with Gravity Forms Limit Submissions.
April 8th, 2021: Migrated to Snippet Library. Added support for deleting Partial Entries.
This article requires the GP Easy Passthrough perk.
Buy Gravity Perks to get this perk plus 47 other premium Gravity Forms plugins!
Overview
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
Prerequisites
Confirm that you have Gravity Forms and Easy Passthrough installed and activated and that you’ve installed 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 delete_partial
to 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.
Wrapping Up
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.
Did this resource help you do something awesome with Gravity Forms?
Then you'll absolutely love Gravity Perks; a suite of 47+ essential add-ons for Gravity Forms with support you can count on.
Hey team, would this work if we wanted to create a secondary form to update only specific fields from the source form?
Have tried this (source form id: 3, new form id: 9, snippet form id is set 3, new form has easy passthrough setup with fields referencing source form) but it doesn’t seem to be working and is creating entries on the new form.
Thanks in advance!
Hi Alex,
Unfortunately, this wouldn’t work for what you’re trying to do. GP Easy Passthrough is unable to update the values in another form’s entry when a form is submitted. Another solution by another developer that may work for you is Gravity Flow’s Form Connector. It lets you update an entry in one form using the values submitted in another form.
Best,
Is it possible to pass a specific entry_id for population rather than just the last entry created? If so, how can that be done without passing values into the URL?
Hi Michael, if you want to populate a specific entry you would use the Easy Passthrough Token appended in the URL as a parameter: https://gravitywiz.com/documentation/gravity-forms-easy-passthrough/#easy-passthrough-token It is not possible to populate a specific entry id without passing the EP Token in the URL.
Hi there! Can you confirm where you place the code snippet so that when a new entry is created is overrides the previous submission? I tried to place it in my functions.php file but encountered an error? Cheers, Phillip
Hi Phillip,
The code snippet is inserted into the function.php file, or you can use a code snippet plugin to add it to the website. Here’s documentation on how to add snippets to a website.
Best,
The snippet contains this on line 19:
private $passs_through_entries;
Is that a typo? Should it be: private $passed_through_entries;
Hi Brian,
Thanks for pointing this out. We have updated the snippet.
Hello, i have an issue when the user submit the form and go to payment method after cancle the order the get back to form it comes empty any suggestion for this what can do for it….
Hi Bhae,
We’ll have to dig into this further to determine why that is happening. If you have an active Gravity Perks license you can get in touch with us via our support form, so we can look into this further.
Best,
This site has an application-for-membership that’s about a kilometre long. Users create an account and start filling in the form. They get tired. Decide to get some sleep. When they decide to come back to it, what’s the page that they should visit? Is it just the application-for-membership form?
I ask because I want to set up a ‘redirect on login’ for people who have started filling out this form.
Hi Chris,
They should visit the page with the original form and the EP Token link added to the URL.
Best,
Hi there. Thanks very much for this. Is it possible to use this approach so that, when you edit the last submitted entry, a post created with that entry is updated at the same time? Many thanks.
Hi Richard,
This isn’t supported in this snippet.
We have had requests for this (including one from you 😁) to add support for this in GP Entry Blocks. This is the more likely place for this to land, however right now it is not supported there either.
This looks like something I’d be able to use! I have a question about the process by which I’d like to use it though.
I have a client who uses Gravity Forms (and some perks) to process automated quotes. Everything else is handled and in place, but they have a “Modify Quote” feature where they want the existing quote information to preload into the form when the user clicks a button from an email (or in the form confirmation message). The crux of this is that we want the new submission to create a new entry, not modify an existing entry.
We’re using URL variables now to preload information into the form when someone clicks that “Modify Quote” link, but some of the information isn’t exactly URL variable friendly, and other parts are conditional logic based, and won’t load, so we’re looking for a better way of doing it.
Would it be possible to pass a variable of say the entry ID and then have Easy Passthrough load the specific information into the form? Or would it need to do something else?
Is any or all of that possible using this perk? And if so, any help would be appreciated!
Hi Brett,
This is an interesting use case. There are two ways you can do this. You can their use GP Easy Passthrough Perk or our GP Populate Anything Perk to populate the fields based on an identifier value passed in the URL as a query parameter. With Easy Passthrough you can pass the Easy Passthrough Token for a specific entry via the URL and that would populate the fields with the data for that entry. When the user submits the form in this case it will create a new entry and a new EP Token will also be created. For GP Populate Anything, you can pass the Entry ID via the URL and then use that value to filter and populate the fields on the form and this will also create a new entry when the user submits the form. Any of these should help with what you’re trying to do. If you have any questions you can get in touch with us via our support form.
Best,
Hello!
I have been testing this feature out and it has been working so far, however, the one issue we are running into is our integration with Google Sheets. We use the WPSyncSheets for Gravity Forms plugin to send our submissions to Google Sheets, however, when we tested it using the edit entry feature with Easy Passthrough, it creates a new submission on the Sheet but with the same Entry ID number. Is there a fix for this issue? Or is there another Google Sheet plugin that would work using EP this way?
Thanks, Luka
Hi Luka,
I believe support for this would need to be built into WPSyncSheets. We update the entry by creating a new entry with the existing entry ID (related hook). This tells Gravity Forms to update the existing entry instead of generating a new one.
WPSyncSheets should be able to interpret that existing Entry ID as an update.
Would this work for maintaining an email subscription list where the people submitting the form never log in? If they are listed in the submission entries, and they wish to unsubscribe, could we edit their previous entry, override it, or delete it with their new submission in which they choose to unsubscribe? It would be based on the email address they enter. Since they might not unsubscribe for a long time, I don’t think anything that expires would work well.
Hi Lori,
If an EP Token is provided, the option to edit entries shouldn’t expire so this might work for your use case.
I hope this helps!
Best,
Hi there,
Would this method be able to work in the following scenario?
We have forms that create a custom post type (example – tickets), user fills in the form and then these are rendered on the front end. User should then be able to edit their own tickets they have created.
Questions:
Can the users edit only their own tickets they created? Can one user have multiple tickets and edit them all? Can users somehow delete their tickets from the front end?
Could you possibly clarify on the above-mentioned before we go ahead and purchase?
Hi Johan,
This solution would only allow users to edit their last submitted entry. If you’re looking for a solution to allow users to manage multiple entries, then I will suggest you check out GravityView.
Best,
Hi
If I use a form to create a new user using the “User Registration Add-On”, is there a way when the user comes back to it then when they re-submit the form I can update the form and the user object if the email is the same As currently if the email is the same then I get the error “This email address is already registered” I have set it that if the form is returned to then the email field is read-only so can’t be changed
Cheers Andy
Hi Andy,
We have a snippet that will let you add both a Create User and Update User feed to the same form. It requires you to set up some conditional logic to choose which feed to trigger. The easiest way to handle this is to use to populate a hidden field with the currently logged-in user’s ID. You can then set the conditional logic on the Update User feed to trigger if the value of that field is greater than 0; The Create User feed would trigger when the hidden field’s value is blank.
Awesome!!! Thanks for the quick reply, works perfectly! :)
Cheers Andy
Hi is it possible to use this to create a new entry?
I,e user or admin, open the submission and changes the data, and resubmit the form so that new notifications are sent and a new submission logged?
I.e we would like to edit and resubmit forms on behalf of users (with a couple of changes)
Hi M,
If you want every update to create a new entry, then ignore the Edit Entry snippet that is mentioned in the article. By default, every update would create a new entry.
Best,
Hi!
Sorry, another question. In case we dont use user login and the session cookie is saved to one browser. Can we somehow increase the Easy Passthrough’s cookie expiration date? I did not find any hook for that.
Best regards, Daniel
Hi Daniel,
Easy Passthrough should allow you to update entries on the Front End. If the cookies are deleted or expired, you can still access the Entry data with the EP Token.
If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.
Best,
Hi!
We are building a big website and would like to clarify that the following scenario is possible:
There is a complex multi-step form. User logs in, fills some of the questions and submits. After a while (for example 2 years), the user logs in again in another browser – then the session cookie is updated and the form is filled with the user’s previous submission. He/she can continue the form and then submit again the new answers. The old entry is updated and overwritten with the latest submission.
Is this possible to achieve with that snippet and the Easy Passthrough addon?
Thank you for your help! Daniel Varga
How can I do this with nested forms? do I have to add another new GPEP_Edit_Entry line in the snippet for another form?
Hi Addy,
The tutorial should work when editing the entry using a Parent form. Nested entries cannot be edited individually.
If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.
Best,
I have to build a site with a lino cpmp[,icated form – the user needs to be able to save or submit the form and then come back and edit the details and keep adding to the form – keeping all the previous data in the form – they might also need to edit it a year later
can your plugin and gravity forms do this?
Hi Paul,
With the EP Token, the user should be able to keep adding data to the form and also keep previously saved data as many times as needed.
If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.
Cheers,
How do I use this technique to edit entries that have a no duplicate fields. Currently I get this error: This field requires a unique entry …
I need there to be no duplicates but I also want the editing to happen if ep token was used.
Please Help, Jimmy
Hi Jimmy,
This will definitely require some custom coding, that will check if the Form is being edited or not to determine whether to disable the “No Duplicate” setting on the field. If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address, and we’ll be happy to assist you.
Best,
Hi Samuel,
Thanks for replying. Sorry, I wasn’t clear enough in my first comment.
At the moment, i have ticked the ‘Use logged in user’s last submitted entry’. During a session, if the user scrolls back and changes the form, the revised form is populated with the previous logged-in data. If the user logs out, logs back in, the newest data is populated. It seems to only show the most recent changes to the form by logging in and logging out.
Ideally I want to show the last submitted entry – either during a session or upon logging back in.
So close to being exactly what i need! any help appreciated.
Simon
Hi Simon, When the ‘Use logged in user’s last submitted entry’ option is enabled the form will always show the values from the last submitted entries without the user having to log out and log in. If it isn’t working for you that way, then there may be something else at play here. You may want to run a conflict test to check if it’s a conflict-related issue. In case it still doesn’t work and you have an active Gravity Perks license, you can get in touch with your account email address via our support form so we dig into this further.
Best,
Works great. One question. I have this working really except for the following Outcome – I want the edit entry functionality – if user logs in our out, the last entry info is prepopulated
It seems i can have both of the above. If i use the “Use logged in user’s last submitted entry” then during the session, it whipes entered info with the previous logged in submitted data – if i un check this, then a returning user does get the prepoulated information
Seems so close. Any help appreciated.
Cheers, Simon
Hi Simon,
If you want non-logged-in users to be able to edit their entries, then you’ll have to use EP Token to prepopulate the form fields for non logged in users. The EP Token will be appended to the URL of the page with the form and that will prepopulate the form fields with the data submitted by the user previously.