I'm facing an issue about a server side Javascript code that I put in place to deal with data management of a column. I have one data extension which contains 3 columns : ID_global, Tech_contact_id, OLD_ID. This DE is filled by almost 200 000 records.
In the column old_id, I have multiple IDs that are seperated by ";". The number of ID is random so it can be 1 or N ids I'm trying to fill another DE with the same 3 columns (ID_global, Tech_contact_id, OLD_ID) but with managing the split of OLD_ID by the ";" separator in order to get 1 ID for each record.
Here is an exemple :
Become :
To do so I coded this script which is doing the job expected with a small amount of records (1000):
<script runat="server">
Platform.Load('core', '1.1.1');
var initDE = DataExtension.Init("Customer key of DE 1");
var initDEData = initDE.Rows.Retrieve();
var targetDE = DataExtension.Init("Customer key of DE 2");
for (var i = 0; i < initDEData.length; i++) {
var id_glob = initDEData[i].Global_ID;
var id_contact = initDEData[i].Tech_contact_id;
var id_old = initDEData[i].Old_id;
var array_id = [];
array_id = id_old.split(';');
for (var j = 0; j < array_id.length; j++){
var processed = targetDE.Rows.Add([{Global_ID:id_glob, Old_id:array_id[j], Tech_contact_id:id_contact}]);
}
}
</script>
However, when i'm running this script with all the records (200 000), the script is running well but is able to add only 10 600 records into the target DE. It correspond to an iteration on 2500 records of the first DE.
Can someone help me out to overcome the limit in number of record we can iterate in SSJS or if i'm doing it the wrong way ?
Thank you in advance for your findings and answers.
Ivan Razine
here ampscript.xyz