0

I'm trying to remove the border only for the last time [content] shows up in a loop. A user can have anywhere from 1 to 3 rows showing. How would I set a conditional statement just for the last occurrence in an AMPScript loop?

%%[ var @rs, @row, @cntr, @link SET @rs = LookupRows("S1", "S2", S3) for @cntr = 1 to ROWCOUNT(@rs) do SET @row = Row(@rs, @cntr) ]%% **[content]** %%[IF ROWCOUNT(@rs) == 0 then]%% %%[ENDIF]%% %%[next @cntr]%% 

1 Answer 1

1

I think you're on the right track. Something like this, perhaps?

%%[ var @rs, @row, @cntr, @link SET @rs = LookupRows("S1", "S2", S3) for @cntr = 1 to ROWCOUNT(@rs) do SET @row = Row(@rs, @cntr) ]%% %%[ IF @cntr < ROWCOUNT(@rs) then ]%% [content] %%[ ELSE ]%% [content displayed on last iteration] %%[ ENDIF ]%% %%[ next @cntr ]%% 
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.