I need to retrieve all rows from a data extension to create a validateEmail API call. There are almost 400 000 users in the data extension, so I need to use WSProxy, because it allows to retrieve more than 2500 rows.
It doesn't work when I try to retrieve data extension.
<script runat='server'>
Platform.Load("core","1.1.1");
var config = {
name: "VegetarianDE" (this is the name of my data extension within contact builder)
cols: ["SubscriberKey, "EmailAddress"] (I have 2 fields in this data extension)
}
var prox = new Script.Util.WSProxy();
var data = prox.retrieve("DataExtensionObject[" + config.name + "]", config.cols);
Write("first row in retrieved data is " + data.results[0].EmailAddress)
</script>
I receive 'first row in retrieved data is undefined'.
results[0]
needs to be capitalized.Results[0]
. JS is case sensitive unlike AMPscript.