Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save katydorjee/54065bc83f4d433385e50bc1dc4c7a8b to your computer and use it in GitHub Desktop.
Save katydorjee/54065bc83f4d433385e50bc1dc4c7a8b to your computer and use it in GitHub Desktop.
Insert Rows into Data Extension using SSJS
<script runat="server">
Platform.Load("Core","1.1.1");
try {
var rowsArr = [
{EmailAddress:"[email protected]",FirstName:"Mary",LastName:"Gold"},
{EmailAddress:"[email protected]",FirstName:"Andrew",LastName:"Pink"},
{EmailAddress:"[email protected]",FirstName:"John",LastName:"Smith"}
];
var customerDE = DataExtension.Init("TEST_Customer_Data");
var status = customerDE.Rows.Add(rowsArr);
/* number of records added to the DE will be returned*/
Write(Stringify(status));
}
catch (e) {
Write(Stringify(e));
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment