How to find duplicates of a field value? For example - in a field, I have values like {123,345,346,123}, now I want to remove the duplicate value in the field so that my output looks like {123,345,346}

How to find duplicates of a field value? For example - in a field, I have values like {123,345,346,123}, now I want to remove the duplicate value in the field so that my output looks like {123,345,346}

If it's an array you want to deduplicate then here is a script [for use in the Script Processor] I prepared earlier:

var result = new Array();

var added = new Object();

If (input1 [0]! = null)

{

for (var i = 0; i)< input1[0].length;="">

{

var point = input1 [0] [i];

If (! added [item])

{

added [item] = 1;

result [result. Length] = item;

}

}

}

Output 1 = result;

Kind regards

Nick

Tags: Fusion Middleware

Similar Questions

Maybe you are looking for