I need to display data from a DataExtension (with more than 2500 records) on a landing page via the the API. As you know there is a cap of 2500 records per API call. But thanks to the StatusOutput of MoreDataAvailable I can keep looping until I get a response of "OK". AMPScript supports a FOR loop but how can I get the count?
This is what I am currently doing.
FOR @i = 1 to @emailCount DO
I need to simulate something like this:
while @statusOutput == "MoreDataAvailable"
SET @retrieveRequest = CreateObject("RetrieveRequest") SetObjectProperty(@retrieveRequest, "ObjectType", "DataExtensionObject[DATAEXTENSION]") AddObjectArrayItem(@retrieveRequest, "Properties","EMAIL_ADDRESS") /* Execute the Retrieve */ SET @emails = InvokeRetrieve(@retrieveRequest, @statusOutput, @requestId) %%[ IF @statusOutput == "MoreDataAvailable" THEN SET @isLoop = 1 ELSE SET @isLoop = 0 ENDIF ]%%