I'm having trouble getting my loop to work. High-level, I'm trying to ask customers to fill out their preferences if the preference field is blank, and if not blank, display what was selected. Easy, right? Not for me!

Here's my script as it is now:

%%[IF SUB_ID == "" THEN]%%
I see that you didn't pick any categories. If you want to add some categories please <a href="">click here</a>.


        SET @Interests = AttributeValue("SUB_ID")
        SET @InterestRows = BuildRowSetFromString(@Interests,",")

VAR @limit,
SET @limit = RowCount(@InterestRows)
FOR @i = 1 TO @limit

           SET @Interest = Row(@InterestRows,@i)
           SET @IntCat = Field(@Interest,1)

I see you like %%=v(@IntCat)=%% 

%%[NEXT @i]%%


I'm stumped. Li'l help?!!?


First I would declare @i with VAR @i before your loop. I don't think that is the issue here... you need to have FOR @i = 1 TO @limit DO ...

You're missing the DO keyword. Hope this helps!

  • AWESOME!!! Thanks Timothy - one small oversight causes so much grief :) – user7827 Jul 22 '14 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.