I've been having some difficulty getting my loop to work properly and was hoping someone could take a look.
The campaign is a recipient is assigned a tier (in this case 1-8), the audience data extension has this listed in [segmentB] The first portion of the email takes this tier and matches the tier to the [GIFTID] column and places the relevant data into variables for the guaranteed gift. What I am trying to do is to select the gift above that tier (IF segmentB == 2, select GIFTID 3) and repeat until the list is exhausted, each time setting the variables for that section of code.
The following AMPscript will pull in one row below the segmentB value, but will simply stop. I assume because it will lookup the row set of the unique "GIFTID" value it does not repeat the lookup on the next loop, but I am not entirely sure.
%%[SET @UPGRADEID = Add(segmentB,1) SET @rows = LookupRows("UEL_PLAY_EARN_TV_01_LOOKUP","GIFTID", @UPGRADEID) FOR @i = 1 TO RowCount(@rows) DO SET @CurrentRow = Row(@rows,@i) SET @IMGURL = Field(@currentrow,"IMGURL") SET @DESC = Field(@currentrow,"DESC") SET @UNIQUEID = Field(@currentrow,"UNIQUEID") IF SEGMENTA == "S" THEN SET @EARN = Field(@currentrow,"SEARN") ELSEIF SEGMENTA == "V" THEN SET @EARN = Field(@currentrow,"VEARN") ENDIF ]%% <table> </table> %%[ NEXT @i ]%%