# Overwrite previously submitted entry

**URL:** <https://community.gravityforms.com/t/overwrite-previously-submitted-entry/11737>\
**Category:** Get Help\
**Tags:** custom, gform\_entry\_id\_pre\_save\_lead, gform\_is\_duplicate\
**Created:** [January 28, 2022, 3:20pm UTC](https://community.gravityforms.com/t/overwrite-previously-submitted-entry/11737 "2022-01-28T15:20:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammed.kadhim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/mohammed.kadhim/32/4492_2.png) [@mohammed.kadhim](https://community.gravityforms.com/u/mohammed.kadhim)\
**Post date:** [January 28, 2022, 3:20pm UTC](https://community.gravityforms.com/t/overwrite-previously-submitted-entry/11737/1 "2022-01-28T15:20:15Z")

</div>

Hello,  
Is there anyway to make each entry overwrite previous submission instead of adding new entry for each list choice?  
To be more clear, I have a form contains a list of 3 choices ( **Choice 1, Choice 2, Choice 3** ) and also some other fields as well. So when someone selects one of these choices (Say **Choice 1** for example), their entry should overwrite the previously submitted entry in which they also selected Choice 1 instead of creating a new entry. So that in the end, the exported CSV file contains only one entry for each choice which reflect values from the latest submission. Hopefully that makes sense.

Kind regards,  
Mohammed Kadhim

---

<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:** [January 28, 2022, 6:22pm UTC](https://community.gravityforms.com/t/overwrite-previously-submitted-entry/11737/2 "2022-01-28T18:22:02Z")

</div>

Hi Mohammed. You can use the gform\_entry\_id\_pre\_save\_lead filter to change the entry ID before a new entry is written:

> **[gform\_entry\_id\_pre\_save\_lead](https://docs.gravityforms.com/gform_entry_id_pre_save_lead/)**
>
> 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:** ![mohammed.kadhim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/mohammed.kadhim/32/4492_2.png) [@mohammed.kadhim](https://community.gravityforms.com/u/mohammed.kadhim)\
**Post date:** [January 28, 2022, 8:16pm UTC](https://community.gravityforms.com/t/overwrite-previously-submitted-entry/11737/3 "2022-01-28T20:16:54Z")

</div>

Thanks Chris. Sorry but I’m still unable to associate that filter with a particular list item. I’ll elaborate further with some images to help you understand what I’m trying to achieve.

Take a look at this simple form which contains a list and a field: **(Refer to IMAGE 1)**

Assume that users made four submissions in which they submitted a value for “Choice 1” two times. Then the entry list would normally look like this: **(Refer to IMAGE 2)**

What I want to do, is to overwrite the previous value submitted along with **“Choice 1”** so that it always show the latest submitted number. The entry list should look like this: **(Refer to IMAGE 3)**

 ![Custom_2](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/d/dd2ffad69d590a74176043fca6f5ad25bb414ab8.jpeg)

The same applies for the other choices in that list **(Choice 2, Choice 3)** entry should always and only shows the latest submitted value for each choice.

BTW, the “No Duplicates” option ALMOST does what I want. Except it completely stops duplicate entry for each list choice instead of overwrite the previous submission.

Hopefully now it makes more sense. I’d really appreciate if you could help me with this.

---

<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:** [January 31, 2022, 7:00pm UTC](https://community.gravityforms.com/t/overwrite-previously-submitted-entry/11737/4 "2022-01-31T19:00:16Z")

</div>

How about if you used the No Duplicates setting as a check for this, and then use this filter to change the entry ID you want updated, somehow 🙂

You can use the `gform_is_duplicate` filter maybe:

> **[gform\_is\_duplicate](https://docs.gravityforms.com/gform_is_duplicate/)**
>
> This filter is executed during the validation of fields marked with the "No Duplicates" rule. Use this hook to specify a custom duplicate validation logic.

Not sure how that would all fit together, but maybe that filter gives you some ideas (like the filter determines that the entry is a duplicate, so then you use the gform\_entry\_id\_pre\_save\_lead filter to update the existing entry?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [March 2, 2022, 7:00pm UTC](https://community.gravityforms.com/t/overwrite-previously-submitted-entry/11737/5 "2022-03-02T19:00:26Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
