Skip to content

Instantly share code, notes, and snippets.

@wvpv
Last active October 6, 2017 11:08
Show Gist options
  • Save wvpv/aef7dd777cbacec227c0 to your computer and use it in GitHub Desktop.
Save wvpv/aef7dd777cbacec227c0 to your computer and use it in GitHub Desktop.
SFMC Lookup Data Extension Rows
<script runat="server">
Platform.Load("core", "1");
var birthdayDE = DataExtension.Init("birthdayDE");
var filter = {
Property: "EmailAddress",
SimpleOperator: "equals",
Value: "[email protected]"
};
var data = birthdayDE.Rows.Retrieve(filter);
Write("<br>data.length: " + data.length);
if (data.length > 0) {
Write("<table border='1' cellpadding='2' cellspacing='3' style='border-collapse:collapse;'>");
for (var i = 0; i <= data.length; i++) {
var d = data[i];
Write("<tr>");
for (var i in d) {
Write("<td>" + d[i] + "</td>");
}
Write("</tr>");
}
Write("</table>");
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment