I'm trying to retrieve the CustomObjectID of a data extension that already exists, by using the External Key/CustomerKey. That didn't work, so now I'm trying to retrieve any DEs at all, and that's not working either. Here is my code, I'm running it in a Landing page:

<script runat="server">
var clientID = Attribute.GetValue('memberid');

var api = new Script.Util.WSProxy();
api.setClientId({"ID": clientID});
var cols = [ "Name", "CustomerKey", "CategoryID", "IsSendable"];
var res = api.retrieve("DataExtension",cols);


I don't get a JSON object back. What is written out is:

System.Collections.Generic.Dictionary`2[System.String, System.Object] 

I don't know what this means, except that there are no data extension objects to return? I'm literally following the exact example in the documentation:-


I can't even get the describe function to work:

var res = api.describe("DataExtension");

returns the same result -


To add to the confusion, I can use describe and retrieve QueryDefinition objects and emailSendDefinition objects just fine - no issue there.


Change the last line to:


Stringify will display the res variable that contains the response as JSON key and values with double quotes.


turns out the issue was with the Stringify function. I did not notice it at the time, but I had a lowercase 's' in my code:


When I should have had


And now everything actually works. The code block where I was using describe for QueryDefinition and EmailSendDefinition had the correct capitalized Stringify().

Lesson learned: starting a new code project on Friday afternoon before a holiday weekend is just not a good idea.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.