I'm trying to output a list of names from a DE into and email and format with commas and "and"
Example Batman, Super Man and Spider Man
%%[ var @rows, @rowCount, @numRowsToReturn, @i set @numRowsToReturn = 0 /* all */ set @rows = LookupOrderedRows("191204-NYC-Marketers-Advisor-XREF", @numRowsToReturn,"FullName asc","SC_ContactID", @SC_ContactID) set @rowCount = rowcount(@rows) ]%% %%[ if @rowCount > 0 then for @i = 1 to @rowCount do var @First, @AdvisorName set @row = row(@rows,@i) set @First = Field(@row,"FirstName") set @AdvisorName = Field(@row,"Advisor Full Name") IF @rowCount == 1 THEN outputline(concat(@AdvisorName)) ELSEIF @rowCount > 1 THEN outputline(concat(@AdvisorName, ",")) ENDIF ]%% %%[ next @i ]%% %%[ else ]%% No rows found %%[ endif ]%%
RESULTS I'm getting is
Batman, Super Man, Spider Man,