AnsweredAssumed Answered

Duplicate Records Within Found Set Identify First Record Problem

Question asked by fp2146 on May 25, 2015
Latest reply on May 25, 2015 by fp2146


Duplicate Records Within Found Set Identify First Record Problem


I have successfully used the following script found in the Knowledge Base to identify duplicate records within a found set, however it does not identify or "Mark" the first record of the duplicated records, only those that are duplicates of the first.  I need to be able to identify all the duplicate/matching records within the found set for further manipulation.  Is there anything I can add to this script to help me Mark the first record within the group of duplicates/matching records?

Thanks for any help.

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