Currently I use LookUpRows('some_DE', 'AMPKEY', '&') to fetch all data from a DE, where every single record has an AMPKEY field with & as the value. Is it possible to perform the same in MC another way?


This is not possible inside AMPScript without the method you described in your question. There are some alternatives that can be used in a non-sendable context though.

In SSJS you can use the core library to use the Rows.Retrieve() method, which can retrieve all rows (up to 2500 record max) inside of a DE.


var  birthdayDE = DataExtension.Init("birthdayDE");
var data = birthdayDE.Rows.Retrieve();

You can also use the API object of DataExtensionObject to gather all the rows as well.

Sample SOAP Envelope:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
 <wsse:UsernameToken wsu:Id="UsernameToken-24440876" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
 <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
 <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
 <ObjectType>DataExtensionObject[Example DE]</ObjectType>
 <Filter xsi:type="SimpleFilterPart">
  • I've read that documentation, however Im running into a problem because I cannot access _Sent dataview using SSJS (without knowing its external key). The way I understand it, system dataviews dont have external keys, which is why I was trying to use ampscript.. however dataviews dont have a field for all records as I've described in my question, so I cannot use ampscript. Is there another way? Is it possible to access dataviews with SSJS?
    – legoMyEgo
    Oct 11 '18 at 12:17
  • That was not the question you asked. That is a completely different question. Please create a new question for this inquiry. Oct 11 '18 at 12:19
  • Here it is, thank you.
    – legoMyEgo
    Oct 11 '18 at 12:25

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.