0

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'.

2
  • 1
    You can't reference the WSProxy retrieve results like that. I'd suggest reviewing the "Format the results" section on Ivan Razine's blog post on this topic: ampscript.xyz/how-tos/… Commented Oct 18, 2022 at 19:42
  • 1
    results[0] needs to be capitalized. Results[0]. JS is case sensitive unlike AMPscript. Commented Oct 19, 2022 at 11:48

0

You must log in to answer this question.

Browse other questions tagged .