0

I wanted to delete bulk records from auto-suppression list, when I deleted 1400 records the following script worked like a charm, but when I delete 90k or 20k records, it only deletes 200 or 300 records at a time.

I have created an automation with script activity which has following code:

<script runat="server">

Platform.Load("Core","1.1.1");

//fetching the email records which needs to be deleted, fetching it from temporary DE which is used as source to store all the emails

     var deleteEmails = DataExtension.Init("ExternalKeyOfSourceDE");
     var data = deleteEmails.Rows.Retrieve();

     for (var i=0; i < data.length; i++) {
     
        
        //storing each value from source DE into 'email' variable and looping through one by one
       var email = data[i].Email;

        //code to delete the stored email records from the 'Suppression Data Extension'
       var deleteRow = Platform.Function.DeleteData('Suppression List Name',['Email Address'],[email]);

    };

</script>

Solution needed for: How can we effectively delete bulk records for eg. 50k records from Aut-Suppression List at a time using SSJS?

1 Answer 1

1

I would suggest the following:

Create a field "deletionMarker" in your auto suppression.

Instead of looping through all email addresses, using SQL (yes, it works: Can Auto-Suppression Configurations be targeted via SQL Query activity?), update all relevant records to the same value in that new field. (say, "true").

Then, just write one line of SSJS:

Platform.Function.DeleteData(myAutoSuppression,['deletionMarker'],['true']);

I did a load test for this a long time ago and noted: 20k records deleted, automation runtime: 16seconds.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .