This is a quick ColdFusion snippet that will process a list and remove any duplicates so that only distinct elements remain. srcList below is the list containing duplicates. distinctList is the resultant list with duplicates removed.
<cfset distinctList = ""/> <cfloop list="#srcList#" index="item"> <cfif NOT ListFind(distinctList, item)> <cfset distinctList = distinctList & IIF(distinctList EQ "",DE(""),DE(",")) & item /> </cfif> </cfloop>
Hope this helps someone!