# Adalo hints: how to prevent from creating duplicate records in the collection (UPDATED with 2nd video)

**URL:** <https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475>\
**Category:** Resources & Tutorials\
**Created:** [October 30, 2020, 12:26pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475 "2020-10-30T12:26:07Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [October 30, 2020, 12:26pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/1 "2020-10-30T12:26:07Z")

</div>

Sometimes one needs to be sure that the value of the property in collection is unique for each record. As an example - you need to be sure that name of the company / restaurant / event / etc. is unique and record with this name can’t be added for the 2nd time.

UPDATE: added a second video how to make a modal window with warnings. Thanks for your comments inspiring that!

UPDATE #2: please note, the check is case sensitive; so “UGC ODEON” and “ugc odeon” will be treated as different entries.

Here is the short tutorial how to prevent from creating “duplicate” records:

[![](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/5/3/53755e4410e0a168563f903b53a1662bf1664e06.jpeg "Adalo Hints: how to prevent from creating duplicate records in the collection") ](https://www.youtube.com/watch?v=5ybmmRBTlvo)

Second video with modal warning:

[![](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/9/3/937ccbf30b9d5fe4f5ee7a86179300ca478bcc1e.jpeg "Adalo hints: Follow-up for "prevent from creating duplicates" video: modal with warning") ](https://www.youtube.com/watch?v=itGUQrN6gfI)

---

<div class="post-metadata">

**Author:** ![IsaacO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/isaaco/32/2389_2.png) [@IsaacO](https://forum.adalo.com/u/IsaacO)\
**Post date:** [October 30, 2020, 2:01pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/2 "2020-10-30T14:01:24Z")

</div>

Perfect. I’ve been struggling with this when trying to register customers and each time they transact. a new customer record is created for the same phone number. Thanks

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [October 30, 2020, 2:12pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/3 "2020-10-30T14:12:50Z")

</div>

Thanks, glad I could help!

---

<div class="post-metadata">

**Author:** ![bhanu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bhanu/32/6859_2.png) [@bhanu](https://forum.adalo.com/u/bhanu)\
**Post date:** [October 31, 2020, 2:45pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/4 "2020-10-31T14:45:28Z")

</div>

@Victor thanks for sharing this, is there a way we can throw an error message to the user as a feedback that **“The record already exists”** on top of this solution? Maybe a Modal screen?

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [November 2, 2020, 9:28am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/5 "2020-11-02T09:28:41Z")

</div>

Hi @bhanu,

Thanks!  
Of course that’s possible. You need to make button “always visible” though.  
Also it’s possible to display a warning string at the screen. Here are the screenshots of the setup:

 ![Screenshot 2020-11-02 at 12.24.53](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/b/b1ebc1d4d657255ae0ab7dd20a343c05c2915b42.png) ![Screenshot 2020-11-02 at 12.25.20](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/9/99f373f9906d9b287ca93760953ffe6bdcc19a41.png) ![Screenshot 2020-11-02 at 12.25.37](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/4/4207e0e224fbd50b7e3a2fbe70296597704629bc.png)

---

<div class="post-metadata">

**Author:** ![bhanu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bhanu/32/6859_2.png) [@bhanu](https://forum.adalo.com/u/bhanu)\
**Post date:** [November 2, 2020, 9:43am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/6 "2020-11-02T09:43:53Z")

</div>

@Victor thanks!

A separate question: can we access users phone contact and let them import into the application during or after the onboarding?

Scenario: I have a gift app where user needs to select contacts from phonebook to send a virtual giftcard for example.

Sorry, for using the current thread to ask this question.

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [November 2, 2020, 9:51am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/7 "2020-11-02T09:51:29Z")

</div>

Hi @bhanu,

Answered in the “Help” category thread, see here:

> [@Import Phone Contacts iOS/Android](https://forum.adalo.com/t/import-phone-contacts-ios-android/5505):
>
> Is there a way I can ask user to import his phone contacts to create a list in Adalo? My app is into gifting and I want user to select a contact from his phone book to schedule and send a gift. Import Birthday & other fields from the phone contacts if possible Help much appreciated. thanks

Best regards, Victor.

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [November 4, 2020, 10:06am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/8 "2020-11-04T10:06:40Z")

</div>

Hi @bhanu,

I’ve created the video with modal, see above.

Best regards, Victor.

---

<div class="post-metadata">

**Author:** ![bhanu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bhanu/32/6859_2.png) [@bhanu](https://forum.adalo.com/u/bhanu)\
**Post date:** [November 4, 2020, 10:07am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/9 "2020-11-04T10:07:55Z")

</div>

@Victor cool, thank you!

---

<div class="post-metadata">

**Author:** ![michaelyung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/michaelyung/32/4417_2.png) [@michaelyung](https://forum.adalo.com/u/michaelyung)\
**Post date:** [November 29, 2020, 9:13am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/10 "2020-11-29T09:13:24Z")

</div>

Hi Victor, thanks for the two videos.

One question - seems the method works for collections like in your examples - company, restaurant, events etc. However, what about collections with relationships ?

For example, let’s say I have a collection for Students, one collection for Courses, and one for Enrolled Courses (with fields like name, Students relationship, Courses relationships). How I can stop duplicate records that one student enrolled to same courses multiple times ?

BTW, not sure why every collection has to has the field “Name” …

---

<div class="post-metadata">

**Author:** ![oper2k](https://avatars.discourse-cdn.com/v4/letter/o/dbc845/32.png) [@oper2k](https://forum.adalo.com/u/oper2k)\
**Post date:** [November 29, 2020, 9:42am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/11 "2020-11-29T09:42:01Z")

</div>

You can change name of record with relationship between students and course. For example student\_email+course\_id and then check the name to unique.

---

<div class="post-metadata">

**Author:** ![michaelyung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/michaelyung/32/4417_2.png) [@michaelyung](https://forum.adalo.com/u/michaelyung)\
**Post date:** [November 29, 2020, 11:37am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/12 "2020-11-29T11:37:37Z")

</div>

Thanks a ton !! I can set the Name with Student\_email, but not the course ID. All I can get is a COUNT from the collection Courses.

In the form, there is a field Course ID, but I set filter to show pull down menu of Course ID … and therefore not an input field … not sure it causes the problem.

Many thanks again.

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [November 30, 2020, 12:48pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/13 "2020-11-30T12:48:01Z")

</div>

Hi @michaelyung,

I’m assuming you’re creating a “Junction table”, to be able to have many-to-many relationships (students ↔ courses)?  
One option is to use @oper2k approach.

There is a possibility to use the same approach as in the original video. I’ve created a small POC, see here:

[![](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/2/f/2fc7505fc66438d6ac39095e953caa985e57a056.jpeg "Adalo experiments: students, courses and creating unique records in a "Enrollments" collection") ](https://www.youtube.com/watch?v=oH4F4AhEj5E)

As for your question about “Name” - (a) you can rename this property and (b) you can move the properties up and down in the collection setup (on the left pane). First property can’t be deleted, but other can be 🙂

Best regards,  
Victor.

---

<div class="post-metadata">

**Author:** ![michaelyung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/michaelyung/32/4417_2.png) [@michaelyung](https://forum.adalo.com/u/michaelyung)\
**Post date:** [November 30, 2020, 2:32pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/14 "2020-11-30T14:32:00Z")

</div>

Thanks Victor for the reply and the time to prepare for the POC video. Yes, what I want to do is to check uniqueness in the junction / associative table (which is popular in DB design). From your video, I believe you solved the problem by the way of presenting the course and the way of “enrolling” the course.

Shall give it a try and also see if it works for other presentation / form approaches. Many thanks again !!

Cheers, Michael

---

<div class="post-metadata">

**Author:** ![Edmunds](https://avatars.discourse-cdn.com/v4/letter/e/b3f665/32.png) [@Edmunds](https://forum.adalo.com/u/Edmunds)\
**Post date:** [February 22, 2022, 1:27pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/15 "2022-02-22T13:27:04Z")

</div>

This solution isn’t working wery well. Because if there will be some slow respond time betwen app and database, which hapens with Adalo quite often, duplicate records will be aded anywey. And if button will be pushed quickly several times in a row there will be even empty entries aded.

Maybe you found some other workorounds?

---

<div class="post-metadata">

**Author:** ![faalsaady](https://avatars.discourse-cdn.com/v4/letter/f/b2d939/32.png) [@faalsaady](https://forum.adalo.com/u/faalsaady)\
**Post date:** [May 18, 2022, 11:20am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/16 "2022-05-18T11:20:14Z")

</div>

Thanks Victor for your explanation, I want to ask can I do this way to prevent the duplication in booking appointment for clinic. to make sure each patient should booked one appointment. other question, when he or she choose a slot , the slot will not be activate for other patients

best regards  
faisal

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [May 23, 2022, 2:34pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/17 "2022-05-23T14:34:53Z")

</div>

Hi @faalsaady,

The easiest way is to create a T/F property for Slot, call it “Booked”, and set it to True after booking.  
And then you’re not allowing to book the slots with “Booked” = True.

Best,  
Victor.

---

<div class="post-metadata">

**Author:** ![AdrianD](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@AdrianD](https://forum.adalo.com/u/AdrianD)\
**Post date:** [August 17, 2022, 8:09pm UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/18 "2022-08-17T20:09:11Z")

</div>

I have ony big problem with that solution. When input is blank, I didn’t write nothing yet. Red sentence is showing all time.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [August 18, 2022, 5:23am UTC](https://forum.adalo.com/t/adalo-hints-how-to-prevent-from-creating-duplicate-records-in-the-collection-updated-with-2nd-video/5475/19 "2022-08-18T05:23:44Z")

</div>

Hi @AdrianD,

Welcome to the community 🥳

You can add a visibility condition to the button that Only visible when the Other Components \> input \> is not equal to \> empty.

Thank you
