arrayutil

nikhilgadodiya
Kilo Contributor

Hi community,

i am using a transform map to add IT Owners in a list type field as follows :

it owner.PNG

but evry time i run i get duplicate entries added please guide me to avoid that.

thanks in advance

6 REPLIES 6

Hi Nikhil,



Also in the above code seems like i picked wrong function.



var arrayUtil = new ArrayUtil();


var targetList = target.u_it_owners.split(',');


var sourceList = source.u_it_owners.split(',');


gs.log("Logs Nikhil targetList"+targetList+"sourceList"+sourceList);


resultList=arrayUtil.union(targetList,sourceList);   // this should work.


target.u_it_owners=resultList.join(',');




Thanks


Srini


Hello Srini,


When I log my sourceList with array index like


gs.log(sourceList[1]);


it is showing me value as undefined.


please check whether


var sourceList = source.u_it_owners.split(',');


is creating an array or not.