How to find and remove duplicate records in my Form
How to find and remove duplicate records in my Form
It is possible to find the duplicate entries in the database and delete them. Below is the example of removing duplicate email entries in your database. You can replace the Email field with the field name that you want to find for duplicate entries.
Create a new function. The function's script can be of the below kind.
// create two lists. one for the duplicates and the other for the original. myList = list(); duplicateRecordIDList = list();
// fetch all the records in the form for each record in myForm [ID != 0] {
// check if there exists a duplicate value, if yes, add the record ID to the duplicateRecordIDList list. if ( myList.contains (record.Email) ) { duplicateRecordIDList.add(record.ID); }
// if there is not a duplicate entry add it to myList List else { myList.add(record.Email); } }
// If you want to delete the duplicate entries, delete from myForm [ID in duplicateRecordIDList ];