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:
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” …
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:
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
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 !!
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.
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