Created
February 9, 2024 05:39
-
-
Save katydorjee/54065bc83f4d433385e50bc1dc4c7a8b to your computer and use it in GitHub Desktop.
Insert Rows into Data Extension using SSJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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