We are having trouble adding records to our Auto-Suppression List.
We've used SSJS to first delete and then add records from our master DE to our Auto-Suppression List. Here is our code:
<script runat="server" type="text/javascript">
Platform.Load("Core","1.1.1");
try{
var suppList = DataExtension.Init("DE External Key is here.");
var datas = suppList.Rows.Retrieve();
for(var i=0; i<datas.length; i++){
var deleteRow = Platform.Function.DeleteData('TestSuppressionListForEmail',['UniqueId'], [datas[i]["UniqueId"]]);
}
var insertList = Platform.Function.LookupRows('DX_UniqueCustomers',['per_email'],[false]);
if(insertList && insertList.length > 0) {
for(var i=0; i<insertList.length; i++) {
var rows = Platform.Function.InsertData("TestSuppressionListForEmail", ["UniqueId", "Email Address", "FirstName", "LastName"], [insertList[i]["Unique_Id"], insertList[i]["email"], insertList[i]["name"], insertList[i]["surname"]]);
}
}
}catch (e) {
Write("<b>Error Message:</b> " + Stringify(e.message) + "<br><br><b>Description:</b> " + Stringify(e.description));
}
</script>
Code works fine for first 2000 records but after that it stops without giving any error. LookupRows function is returning 2000 records. Our master DE contains more than 5 million records and we expect to have more than 1 million records in our Auto-Suppression List. We didn't get any error message. I believe this is happening due to limits. Can someone tell me the mistake we did and how to fix it?