# Solution to Prevent Duplicate Entry

**URL:** <https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467>\
**Category:** Ask for Help\
**Created:** [October 22, 2020, 7:32pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467 "2020-10-22T19:32:41Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [August 26, 2021, 3:23pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/41 "2021-08-26T15:23:55Z")

</div>

The action IF Name is not included in Name then Add Row else Delete Row … on Submit of a form  
The error message is displayd, but the Row is added.  
If a solution like this ACTION works with an application and does’nt work with another, I think there are a problem somewhere (I build an app test with 2 sheets, very lite and simple : only a column : Name. ) but I don’t know how to prevent duplicate entry in a form.  
Thanks

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 26, 2021, 3:42pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/42 "2021-08-26T15:42:50Z")

</div>

I’m not sure I understand, but… a question. Are you using a custom form or a native Glide form?  
If you’re using native forms there is no way to prevent duplicate entries. This is because nothing is written to the table until the form is submitted, and so there is no way to detect the duplicate.

This is where custom forms come in. With a custom form, you target your input components at User Specific Columns, and the values are written to those columns immediately. You can then use those to detect duplicates _before_ the form is submitted and take appropriate action.

Here is a concept app that demonstrates how to do it:

> [@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:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [August 26, 2021, 3:50pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/43 "2021-08-26T15:50:33Z")

</div>

In fact I use a Native Glide form, I think to use a custom form, In this exemple The Action works very well, thanks for the exemple of app.

---

<div class="post-metadata">

**Author:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [August 27, 2021, 7:34am UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/44 "2021-08-27T07:34:50Z")

</div>

This exemple is very clear and resolve one problem, but I have another.  
My application manages a sports club. I would like to prevent members from registering several times for the same session.  
I can detect duplicate cases with only one field: Name, but there are cases where husband and wife register at the same time for the same date and time.  
I would therefore like to concatenate the 3 fields into one automatically, as in Excel = “name” & “first name” & “date” on a “merge” field when typing so as to obtain a field containing “Namefirst namedate” . I will then use the technique of duplicate detection on a single field.  
thank you in advance for your help

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 27, 2021, 8:12am UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/45 "2021-08-27T08:12:16Z")

</div>

It’s the same concept.  
You just need to create matching [template columns](https://docs.glideapps.com/all/reference/data-editor/computed-columns/template-column) based on your criteria, then build a relation between the two templates. If the relation is not empty, then you have a duplicate.

---

<div class="post-metadata">

**Author:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [August 27, 2021, 8:16am UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/46 "2021-08-27T08:16:57Z")

</div>

Very correct, in reality I did not understand how to create template field, but now I think I understood how to get it, thanks

---

<div class="post-metadata">

**Author:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [September 3, 2021, 10:42am UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/47 "2021-09-03T10:42:07Z")

</div>

Hello  
In my Duplicate validation, it may happen that the same event can be offered on another date and that the person has already registered for the previous event. In this case it appears as a duplicate. So I need to transfer the date of the event to the rel-dup relation field.  
I thought about creating a relation with a calculated field (Template: Name-Date) in the Event sheet and also a calculated field (Template Name-Date) in the Registration sheet.  
I created the relationship in the Event sheet between these two fields. But no data is displayed. While the relation Name (in Event) and Name (in registration) displays the number of rows.  
I have no other ideas, maybe you have a better one of how to transfer, to relate several fields of the same sheet to another sheet? Thanks for your advices.

---

<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 3, 2021, 11:46am UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/48 "2021-09-03T11:46:07Z")

</div>

Do you have a screenshot of your template and relation columns?

---

<div class="post-metadata">

**Author:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [September 3, 2021, 12:15pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/49 "2021-09-03T12:15:23Z")

</div>

Yes, thanks for your help

Sheet Event

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/9/69cd78efd187a0828f8ad36445f2edfad7474ef5.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/0/6062682e69d43f5f9dfffdbcd755a7ed6f79fc55.png)

Sheet Registration (Inscription)

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/9/a9cfa857deb170ab3f3931e362c308943bb1e246.png)

---

<div class="post-metadata">

**Author:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [September 3, 2021, 12:23pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/50 "2021-09-03T12:23:33Z")

</div>

Here a better copy screen

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/e/2e3b79be2c668e3d98f94cf3d16d36dbd61f7066.png)

---

<div class="post-metadata">

**Author:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [September 3, 2021, 12:25pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/51 "2021-09-03T12:25:50Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/8/c8e5cb1fe48698654361cea072b48aa9d7bf5f6c.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 3, 2021, 12:46pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/52 "2021-09-03T12:46:55Z")

</div>

I think your dates are in different formats on each sheet, so the templates don’t match. On your event sheet it looks like you are using the ‘short’ date format and on the registration sheet, it’s the ‘medium’ format. For relations to work, each value that’s being compared has to match exactly. If you need to, you can create a math column in one of the sheets to convert the same date from short to medium, or vice versa. You only have to do it in one of them. Then use that math column in the template instead of the date column.

When you put a date in a template column, it becomes a string and locks in that format, so it’s no longer a date.

---

<div class="post-metadata">

**Author:** ![Leonfort2](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@Leonfort2](https://community.glideapps.com/u/Leonfort2)\
**Post date:** [September 3, 2021, 1:06pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/53 "2021-09-03T13:06:19Z")

</div>

Thank you very much, indeed it is about the difference in format of the dates. I corrected this and everything is OK

---

<div class="post-metadata">

**Author:** ![hendrakei](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hendrakei/32/34058_2.png) [@hendrakei](https://community.glideapps.com/u/hendrakei)\
**Post date:** [December 8, 2021, 9:11am UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/54 "2021-12-08T09:11:57Z")

</div>

Hi @Wiz.Wazeer i need this for my app, this really help.  
but i checked the link already expired, can i get the new one?  
thank youu.

---

<div class="post-metadata">

**Author:** ![Sachin\_singh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sachin_singh/32/41157_2.png) [@Sachin\_singh](https://community.glideapps.com/u/Sachin_singh)\
**Post date:** [April 4, 2022, 1:22pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/55 "2022-04-04T13:22:18Z")

</div>

@Darren_Murphy Can you share the app that you demonstrated for duplicate entry? I am still not able to figure it out!

---

<div class="post-metadata">

**Author:** ![Sachin\_singh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sachin_singh/32/41157_2.png) [@Sachin\_singh](https://community.glideapps.com/u/Sachin_singh)\
**Post date:** [April 4, 2022, 1:22pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/56 "2022-04-04T13:22:51Z")

</div>

It is the perfect solution to this problem!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 4, 2022, 1:49pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/57 "2022-04-04T13:49:05Z")

</div>

You can copy the app from the following topic:

> [@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:** ![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 12, 2022, 10:33am UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/58 "2022-09-12T10:33:02Z")

</div>

Lifesaver. Thank you

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 12, 2022, 12:13pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/59 "2022-09-12T12:13:20Z")

</div>

That is not a recommended solution since “On submit” actions are not reliable. If the row was not created in time for the delete action to kick in, then the row might still be there and the action fails to do anything.

I think the best thing is still to use a custom form.

---

<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:16pm UTC](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467/60 "2022-09-19T23:16:59Z")

</div>

Can you apply the same on glide pages ?  
Thanks!

[Previous page](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467.md?page=2)

[Next page](https://community.glideapps.com/t/solution-to-prevent-duplicate-entry/17467.md?page=4)
