0

I have a Data Extension with list of subscribers I need to suppress (Suppression DE). I want a monthly automation that picks up the emails from this Suppression DE and then overwrites it to the the new Auto Suppression List that I created.

Steps:

  1. Automation to pick up the emails from DE and overwrite the Auto Suppression List
  2. Also I want to assign this suppression list to all my journeys & email send-out. How Can I do this?

Could anybody let me know how can I resolve this issue?

0

2 Answers 2

1

Although @SwatiMishra's answer may work, it is a bit more complicated than it needs to be. Regular and Auto Suppression lists can be imported into through an Import Activity.

So all you need to do is create an automation with 3 activities in it.

  1. Data Extract Activity - use this as a data extension extract activity to move the data extension information into a CSV file on the ftp safehouse
  2. File Transfer Activity - use this to move the file from the safehouse into a specific directory/folder in your FTP
  3. Import Activity - use this activity to import your CSV file into the appropriate suppression list you are using.

Regular Suppression Lists
Inside the Import Activity, you would just click on the 'Subscriber List' tab in the Destination section and there you will see 'Suppression Lists' on the left side with the folder navigation.

Auto Suppression Lists
Inside the Import Activity, you would click the 'Data Extensions' tab and then scroll down to the bottom to a folder that says 'Auto-Suppression Configuration'. This will contain the Auto-Suppression lists inside your account. You can then select one of these as the target of your import.

As to assignment, by default these can be set to account wide, business unit specific or sender profile. This can be set inside Email Studio > Admin > Send Management > Auto-Suppression Configuration > Check the box next to the list > Properties. Inside that window you then look for the 'assignment' section. Look at this link for more details.

3
  • I agree, but clients refrain from adding list containing email address into SFTP. Oct 21, 2021 at 13:10
  • @SwatiMishra - But that was not in the question. The question made no mention of restrictions like that. Oct 21, 2021 at 13:15
  • 1
    Agree :). Thats a valid point. Oct 21, 2021 at 13:16
2

Auto Supression list at the back end are Data extensions. You have to create a ssjs script that will create a SQL activity to extract records from your source DE and insert in the auto supression list. You can use the below script.

    <script runat="server">

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

               var Query_Name = "your_query_activity_name";
               var Query_Key = Platform.Function.GUID();
               var Data_Extension_Name = "Your auto suppression list name";
               var Update_Type = "Overwrite";

               var Query_Text = 
"SELECT DISTINCT\n"+
"\n"+
"p.Email_Address AS [Email Address],\n"+
"GETDATE() AS [Date Added]\n"+
"\n"+
"FROM source de";


               var rr = Platform.Function.CreateObject("RetrieveRequest");
               Platform.Function.SetObjectProperty(rr,"ObjectType","DataExtension");
               Platform.Function.AddObjectArrayItem(rr,"Properties","Name");
               Platform.Function.AddObjectArrayItem(rr,"Properties","CustomerKey");

               var filter = Platform.Function.CreateObject("SimpleFilterPart");
               Platform.Function.SetObjectProperty(filter,"Property","Name");
               Platform.Function.SetObjectProperty(filter,"SimpleOperator","Equals");
               Platform.Function.AddObjectArrayItem(filter,"Value",Data_Extension_Name);
               Platform.Function.SetObjectProperty(rr,"Filter",filter);

               var results = Platform.Function.InvokeRetrieve(rr, statusAndRequestID);

               if((results.length == null) || (results.length == 0))
                              Write("<li style='color:red'>Target data extension "+Data_Extension_Name+" not found</li>");
               else
               {
                              Write("<li>Target data extension "+Data_Extension_Name+" found</li>");

                              var Data_Extension_Key = results[0]["CustomerKey"];
 Write(Data_Extension_Key);
                              var queryDefinition = Platform.Function.CreateObject("QueryDefinition");
                              Platform.Function.SetObjectProperty(queryDefinition,"Name",Query_Name);
                              Platform.Function.SetObjectProperty(queryDefinition,"CustomerKey",Query_Key);
                              Platform.Function.SetObjectProperty(queryDefinition,"TargetType","DE");
                     Platform.Function.SetObjectProperty(queryDefinition,"TargetUpdateType",Update_Type); // You can chose to overwrite your suppression list
                              Platform.Function.SetObjectProperty(queryDefinition,"QueryText",Query_Text);

                              var dataExtensionObject = Platform.Function.CreateObject("InteractionBaseObject");
                  Platform.Function.SetObjectProperty(dataExtensionObject,"Name",Data_Extension_Name);
               Platform.Function.SetObjectProperty(dataExtensionObject,"CustomerKey",Data_Extension_Key);
               Platform.Function.SetObjectProperty(queryDefinition,"DataExtensionTarget",dataExtensionObject);

                              var StatusAndRequestID = [0,0];
                              var result = Platform.Function.InvokeCreate(queryDefinition,StatusAndRequestID,null);
                              var status = StatusAndRequestID[0];
                              var requestID = StatusAndRequestID[1];

                              Write("<li>RequestId: "+requestID+"</li>");
                              Write("<li>Status: "+status+"</li>");

                              if(result == "OK")
                                             Write("<li style='color:green'>Result1: "+result+"</li>");
                              else
                                             Write("<li style='color:red'>Result2: "+result+"</li>");
                              Write("</p>");
               }

               Write("</p>");

</script>

You can run this script on a cloud page or ssjs activity. Once the sql activity is created , you drag that activity in the Automation. To suppress this list from all send outs, just associate your auto suppression list to send classifications https://help.salesforce.com/s/articleView?id=sf.mc_es_create_auto_suppression_list.htm&type=5

3
  • Thanks a lot for the answer.
    – rtys
    Oct 21, 2021 at 15:01
  • Hi Swati, I have a question in your code. 1. Why are you using Query_Name & Query_Text? 2. Should we create a SQL query activity for this and what to place & where to place the SQL activity.
    – rtys
    Nov 4, 2021 at 12:03
  • Query Name: Is the query activity name. Query text: Is your actual SQL query Yes you have to create the SQL query activity and place it in automation studio. To create the SQL query activity you have to do it on a cloud page by running this code. Once done, you have to place the activity in the AS which will populate your suppression list Nov 5, 2021 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.