PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Overwrite Entries

  1. I am currently developing a site where logged in users can fill out a form multiple times. I am only interested in saving their latest entry though, and not a history of all their entries. Ideally I'd like an option where a gravity form could lookup the user_id and form_id and if one exists, it would overwrite the user's previous entry.

    I know this is a pretty specific case so my more practical request is to have a gform_pre_submission_lead_filter for the $lead variable in form_display.php line 78 before handle_submission. That way in my custom filter I can look up the lead and pass back a non-null lead if the user already filled out the form so it doesn't get inserted again.

    Posted 11 years ago on Monday November 26, 2012 | Permalink
  2. David Peralty

    You could use gform_after_submission, and grab all leads with their user_id and remove all but the latest one. It would require some intermediate level PHP coding. Though, there is this code to remove the current entry upon submission that you could use as a starting point -

    Posted 11 years ago on Monday November 26, 2012 | Permalink
  3. It would be pretty inefficient to do that, but I guess I have to do it. thanks for the reply.

    Posted 11 years ago on Wednesday December 5, 2012 | Permalink