Thank you for your prompt response! I guess it probably would have been helpful if I showed the results of the script...
Unfortunately, running the script produces the same results whether the Set Variable [$id; Value ...] is before or after Loop.
There are strange problems with the results as well.
A partial screenshot:
As you can see, the UniqueID field seems to be working correctly. The script not so much.
First, shouldn't the script result in a list of only records marked as duplicates (an "X" in the Duplicate field)?
Second, why are some records marked as duplicates when they're obviously not?
I would definitely like to try your more efficient version of the script, would your three steps simply replace all actions between Loop and End Loop? And should it look exactly as you've typed?
I so appreciate your help.