[SalesForce] Retrieve Data Extension rows using WSProxy

I just learned how to use WSProxy as an alternative to use in Salesforce Marketing cloud. The SF documentation provides retrieve data but is only limited in retrieving data extension schema and details.

var prox = new Script.Util.WSProxy();
var props = { QueryAllAccounts: true };
var cols = ["Name","CustomerKey","CategoryID","IsSendable"];
var filter = {
    Property: "CategoryID",
    SimpleOperator: "equals",
    Value: 101367
};
var opts = {
    BatchSize: 25
};
var data = prox.retrieve("DataExtension", cols, filter, opts, props);

Is there a retrieve functionality for data extension rows in WSProxy, something like:

var prox = new Script.Util.WSProxy();
var cols = ["Field1","Field2","Field3","Field4"];
var filter = {
    Property: "Field1",
    SimpleOperator: "equals",
    Value: 101367
};

var data = prox.retrieve("DataExtensionObject", cols, filter);

Best Answer

You should be able to accomplish this with the below snippet. You just need to adjust to fit your needs:

var prox = new Script.Util.WSProxy(); //creates proxy for SOAP call

var subKey = 'something@example.com';
var deCustKey = 'DataExtensionTest'; //your DE's CustomerKey / External Key

var cols = ["Field1","Field2","Field3","Field4"];
var filter = {
    Property: "Field1",
    SimpleOperator: "equals",
    Value: 101367
};

var desc = prox.retrieve("DataExtensionObject[" + deCustKey + "]", cols, filter); //executes the proxy call
Related Topic