Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zuzannamj/ab6d4ee38a69cf7f51b6bbb4ad0cd02b to your computer and use it in GitHub Desktop.
Save zuzannamj/ab6d4ee38a69cf7f51b6bbb4ad0cd02b to your computer and use it in GitHub Desktop.
<script runat="server">
Platform.Load("core","1.1.5");
try{
var prox = new Script.Util.WSProxy();
var CustomerKey = []; //Create an array withh DE External Keys
var IsSendable = "true",
SendableDataExtensionField = {"Name": "email", "DataType": "EmailAddress"}, //Provide the name of the field used to establish a data relationship (SendableDataExtensionField relates to subscribers on SendableSubscriberField)
SendableSubscriberField = {"Name": "Subscriber Key"}; //Use "Subscriber Key" or "Email Address" depending on whether the SUBSCRIBER_KEY business rule has been turned on.
for(var i=0; i< CustomerKey.length; i++) {
var res = prox.updateItem("DataExtension", {"CustomerKey":CustomerKey[i], "IsSendable":IsSendable, "SendableDataExtensionField":SendableDataExtensionField, "SendableSubscriberField":SendableSubscriberField});
Write(Stringify(res) + "<br>");
}
}catch(e){
Write(Stringify(e));
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment