AnsweredAssumed Answered

Removing Duplicate Records Script

Question asked by sportyguy209 on Oct 23, 2014
Latest reply on Oct 23, 2014 by sportyguy209


Removing Duplicate Records Script


I found the following script for finding duplicate records on the FileMaker website, but when I get to the if Statement after the Loop, I keep getting an error message that the database can't be found. Any help would be appreciated. TIA

Show All Records
Sort Records [Restore; No dialog] <--- Sort by the UniqueID field in ascending order
Go to Record/Request/Page [First]
Set Variable [$id; Value:SampleTable::UniqueID] <-- Sets "$id" variable to be equal to UniqueID field

Replace Field Contents [No dialog; SampleTable::Mark; " "] <--- Replace the contents of the "Mark" field with a blank (" ")
     Go to Record/Request/Page [Next, Exit after last]
     If [$id = SampleTable::UniqueID]
          Set Field [SampleTable::Mark; "X"] <--- Marks record as a duplicate by placing an "X" in the "Mark" field
          Set Variable [$id; Value:SampleTable::UniqueID]
     End If
End Loop
Perform Find [Restore] <-- Finds all records where Mark = X.  You will need to define the find criteria for this script step
I found the following info for creating a script to find duplicate records in FileMaker.