# Update existing entry with second submission

**URL:** <https://community.gravityforms.com/t/update-existing-entry-with-second-submission/9689>\
**Category:** Get Help\
**Tags:** gform\_entry\_id\_pre\_save\_lead\
**Created:** [June 4, 2021, 7:47pm UTC](https://community.gravityforms.com/t/update-existing-entry-with-second-submission/9689 "2021-06-04T19:47:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danvanah](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/danvanah/32/1211_2.png) [@Danvanah](https://community.gravityforms.com/u/Danvanah)\
**Post date:** [June 4, 2021, 7:47pm UTC](https://community.gravityforms.com/t/update-existing-entry-with-second-submission/9689/1 "2021-06-04T19:47:31Z")

</div>

Scenario: Form is submitted creating entry #1. A special link brings user to the same form pre-filled with entry #1 values. Form is submitted, updates entry #1 with changed values, confirmations and notifications are processed again.

I only need help with the second submission, how to overwrite the original entry, without creating a second entry. I tried doing this multiple ways, the biggest hiccup involved file upload fields.

Any suggestions? Thanks!

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [June 8, 2021, 5:28pm UTC](https://community.gravityforms.com/t/update-existing-entry-with-second-submission/9689/2 "2021-06-08T17:28:46Z")

</div>

How about using this filter to change the entry ID before save?

> **[gform\_entry\_id\_pre\_save\_lead - Gravity Forms Documentation](https://docs.gravityforms.com/gform_entry_id_pre_save_lead/#examples)**
>
> Allows entry id to be changed before submission is saved. Useful to update an existing entry instead of creating a new one.

---

<div class="post-metadata">

**Author:** ![Danvanah](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/danvanah/32/1211_2.png) [@Danvanah](https://community.gravityforms.com/u/Danvanah)\
**Post date:** [June 8, 2021, 6:34pm UTC](https://community.gravityforms.com/t/update-existing-entry-with-second-submission/9689/3 "2021-06-08T18:34:43Z")

</div>

Thanks for the reply Chris! Yes, that filter works and it was part of my initial attempts. What can I do about a file upload field? If entry #1 has file uploads, how can I output them pre-filled in a way that won’t erase/overwrite the uploads from entry #1?

When presenting entry #1 for review, I’m using the gform\_field\_content filter to output a hidden field (and iframes displaying the actual files, but that’s besides the point). The hidden field is not working, as the second submission results in the file upload field being cleared. Here’s the code:

```auto
//... code during gform_pre_render hook, entry #1 is located
$files = rgar($entry, $field->id) ) ) { // File Upload field

add_filter( "gform_field_content_{$form['id']}_" . $field->id, function ( $content, $field, $value, $entry_id, $form_id ) use ($files) {
	
	$content = '<input type="hidden" value="'.urlencode($files).'" name="input_'.$field->id.'" id="field_'.$form_id.'_'.$field->id.'">';

	//...additional $content...

	return $content;
}, 10, 5);

```

I’ve successfully used the `gform_save_field_value` filter to short-circuit overwriting the entry values (by returning an empty array), and this works! However, the result is an incomplete entry object that interferes with confirmations and notifications.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [June 9, 2021, 2:36pm UTC](https://community.gravityforms.com/t/update-existing-entry-with-second-submission/9689/4 "2021-06-09T14:36:26Z")

</div>

I think you are going to run into issues with browser security when attempting to pre-fill a file upload field. I’ll leave this open in case anyone can add any information.

---

<div class="post-metadata">

**Author:** ![JamieO](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/jamieo/32/2521_2.png) [@JamieO](https://community.gravityforms.com/u/JamieO)\
**Post date:** [June 14, 2021, 2:07am UTC](https://community.gravityforms.com/t/update-existing-entry-with-second-submission/9689/5 "2021-06-14T02:07:06Z")

</div>

Hi Danvanah,

Have you looked at what Gravity Flow provides? I could interpret what you are asking to do in a couple different ways as it relates to multiple submissions affecting one entries’ values…

**Form 1 having a [user input step](https://docs.gravityflow.io/article/23-configuring-user-input-step) followed by a [notification step](https://docs.gravityflow.io/article/72-email-notifications).**  
In this way you don’t need an actual second entry and the latest updated values are always stored in entry #1.

**[Form Connector Extension](https://gravityflow.io/downloads/form-connector/) with [Update an Entry step](https://docs.gravityflow.io/article/149-update-an-entry) and [Delete Entry step](https://docs.gravityflow.io/article/201-delete-an-entry)**  
In this way you have a full second submission. You’d need some way to make the association between entry 1 and entry 2 perhaps by passing via query string for hidden field.

Our support team is available to help you if you get stuck on any initial implementation issues.

Regards,  
Jamie

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 5, 2022, 8:32am UTC](https://community.gravityforms.com/t/update-existing-entry-with-second-submission/9689/6 "2022-01-05T08:32:35Z")

</div>


