# Prevent duplicates from text entry

**URL:** <https://community.glideapps.com/t/prevent-duplicates-from-text-entry/49233>\
**Category:** Ask for Help\
**Created:** [September 13, 2022, 3:46pm UTC](https://community.glideapps.com/t/prevent-duplicates-from-text-entry/49233 "2022-09-13T15:46:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcus\_Shamase](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/marcus_shamase/32/45840_2.png) [@Marcus\_Shamase](https://community.glideapps.com/u/Marcus_Shamase)\
**Post date:** [September 13, 2022, 3:46pm UTC](https://community.glideapps.com/t/prevent-duplicates-from-text-entry/49233/1 "2022-09-13T15:46:49Z")

</div>

I am trying to prevent duplicates from the entered text fields, but now it does not add any new data from the field, it also removes it.

I am also using this on submit action. I want to delete the action row there.

Sample  
 ![text entry](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/6/f6779275eea95455d8dd48019086c4cd9c1437d4.png)

Action I am using  
 ![screen](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/c/3c7faf92b3fa3226537ac9d9eb2766c1ffbb8d2d.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 13, 2022, 4:22pm UTC](https://community.glideapps.com/t/prevent-duplicates-from-text-entry/49233/2 "2022-09-13T16:22:18Z")

</div>

It’s not good practice to add a row and immediately delete it afterwards. It’s most likely adding a row, then your On submit is possibly comparing Product Code to itself, so it will always match and take the Delete path. Also, your Else is essentially adding an Add Row action to a form that already adds a row, so if it did work, you would end up with duplicate rows each time you submit. When using a native form, don’t ever use an Add Row action On Submit, unless you want to add a row to the form table as well as add a row to a different table. In most cases, it’s not necessary and redundant.

I would create a Custom Form for this use case. Then you can check for a duplicate while filling out the form and hide or show the submit button as needed.

> [@How do I create a custom form?](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014):
>
> I’m just dropping this here so I have something to refer people to when they ask. This is a simple concept app (copyable), that demonstrates the following techniques: Building custom forms for adding and editing list items (as an alternative to the native forms provided by Glide) Preventing duplicate new entries using [User Specific Columns](https://docs.glideapps.com/all/reference/data-editor/user-specific-columns) and [Relations](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column) Enforcing mandatory input items The use of visibility conditions and user specific booleans to control user flow There is nothing particula…

---

<div class="post-metadata">

**Author:** ![Gideon\_Nyamekye](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gideon_nyamekye/32/48044_2.png) [@Gideon\_Nyamekye](https://community.glideapps.com/u/Gideon_Nyamekye)\
**Post date:** [September 19, 2022, 11:26pm UTC](https://community.glideapps.com/t/prevent-duplicates-from-text-entry/49233/3 "2022-09-19T23:26:16Z")

</div>

Do you have a step by step instructions on how to do this?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 20, 2022, 1:10am UTC](https://community.glideapps.com/t/prevent-duplicates-from-text-entry/49233/4 "2022-09-20T01:10:53Z")

</div>

I don’t have anything written down, and it probably varies depending on the use case. What are you trying to do?

If you look at @Darren_Murphy’s post, that I linked to above, he has a sample app you can copy, which uses a custom form. Basically it’s a detail screen where you have components that fill user specific columns. in a table. Once you have those values filled, you can have a button with an Add Row action that will take those users specific values and write them to any table you want.

If you are asking specifically about checking for duplicates, then you can add relations in the table that has the user specific columns. That relation would take the value you entered and link it to the table that has all of your submitted form rows. If there is a match, then you have a duplicate. In that case you could set visibility on your submit button to only show when the relation is empty. If it’s not empty, then you could show a hint saying that there is a duplicate.

---

<div class="post-metadata">

**Author:** ![Gideon\_Nyamekye](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gideon_nyamekye/32/48044_2.png) [@Gideon\_Nyamekye](https://community.glideapps.com/u/Gideon_Nyamekye)\
**Post date:** [September 20, 2022, 7:07am UTC](https://community.glideapps.com/t/prevent-duplicates-from-text-entry/49233/5 "2022-09-20T07:07:28Z")

</div>

Thank you Jeff, this is helpful! I was actually referring to preventing duplicate entry which you have explained in detailed for me.  
Thanks!
