Skip to content

Instantly share code, notes, and snippets.

@katydorjee
Created March 28, 2017 07:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katydorjee/aa98e4741fff5e7e5a6e908e9d286988 to your computer and use it in GitHub Desktop.
Save katydorjee/aa98e4741fff5e7e5a6e908e9d286988 to your computer and use it in GitHub Desktop.
For loop in Ampscript
%%[
SET @pl = "a|b|c|d|e"
SET @prefArray = BuildRowSetFromString(@pl,"|")
SET @rCount = RowCount(@prefArray)
FOR @i = 1 TO @rCount DO
SET @ddd = Field(Row(@prefArray, @i),1)
]%%
%%=V(@ddd)=%% <br>
%%[
NEXT @i
]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment