Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
%%[
var @i, @rows, @row, @productName, @prevProductName, @rowsToReturn
set @rowsToReturn = 0 /* up to 2000 */
set @rows = LookupOrderedRows("SubscriberProducts" ,@rowsToReturn, "ProductName asc", "EmailAddress",emailaddr)
set @prevProductName = ""
for @i = 1 TO RowCount(@rows) DO
set @row = Row(@rows,@i)
set @ProductName = Field(@row, "ProductName")
if empty(@prevProductName) or @productName != @prevProductName then
set @prevProductName = @productName
]%%
<h1>%%=v(@productName)=%%</h1>
%%[ endif ]%%
%%[ next @i ]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment