arrayutil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 04:45 AM
This is just a comma-separated string, so in your transform map, you can do something like this:
var arrayUtil = new ArrayUtil();
var targetList = target.u_it_owners;
var sourceList = source.u_it_owners;
var sourceListArray = new Array();
sourceListArray = sourceList.slice(',');
var targetListArray = new Array();
targetListArray = targetList.slice(',');
var newListArray = new Array();
for(var i=0; i<listArray.length; i++){
if(arrayUtil.indexOf(targetListArray, listArray[i]) == -1){
newListArray .push(listArray[i]);
}
}
target.u_it_owners += newListArray.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 04:52 AM
Hi Nikhil,
Are you trying to add to it to the existing list? . What is the expected Source Field value? Comma separated String with Sys_ids? If yes, Below should work. If not please describe more?
var arrayUtil = new ArrayUtil();
var targetList = target.u_it_owners.split(',');
var sourceList = source.u_it_owners.split(',');
resultList=arrayUtil.concat(targetList,sourceList);
target.u_it_owners=resultList.join(',')
Thanks
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 07:14 AM
Hi Srini,
Actually I am trying to add to existing list where some users are already present.I want to first match whether user is already present in IT Owners list or not if it is present then I will ignore him or else I will add him.
I tried solution provided by you earlier but it is not working.
Please assist me through it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2016 07:22 AM
Nikhil:
Something like this?
var ownersList = u_it_owners.split(',');
u_it_owners = new ArrayUtil().unique(ownersList);
See if that works.
Steven.