Skip to content

Instantly share code, notes, and snippets.

@zuzannamj
Created December 1, 2019 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zuzannamj/4d2e77158dedfc6a4c3f56ec34cbcc65 to your computer and use it in GitHub Desktop.
Save zuzannamj/4d2e77158dedfc6a4c3f56ec34cbcc65 to your computer and use it in GitHub Desktop.
%%[ var @rows, @row, @rowCount, @subKey, @counter, @orderItem
set @subKey = _subscriberkey
set @rows = LookupRows("Orders","CustomerId", @subKey)
set @rowCount = rowcount(@rows)
for @counter = 1 to @rowCount do /* repeat in a loop for as many times as defined in rowCount */
set @row = row(@rows, @counter) /* get row based on counter */
set @orderItem = field(@row,"OrderItem")
]%%
<br>
Order item %%=v(@counter)=%%: %%=v(@orderItem)=%%<br>
%%[ next ]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment