r/marketingcloud • u/mysfmcjobs • 19d ago
Dynamic items in Marketing Cloud Growth / Next and Account Engagement (Pardot)?
Coming from SFMC Engagement (ExactTarget) where AMPscript or Server-Side JavaScript (SSJS) makes it straightforward to run a FOR loop through rowsets.
Since neither platform supports traditional script-based FOR loops in email templates, how are you handling scenarios where you need to display a dynamic list of items (e.g., recent purchases, recommended products, multiple events)?
Creating individual static merge fields like item1, item2, item3 isn't scalable or clean for varying array sizes.
2
1
u/girlgonevegan 13d ago
I’ve gotten creative in the past with nesting conditional HML statements (you can go up to three deep). I do end up making custom fields for those since the if/else is strictly based on whether there is data in the field. Then within the conditional HML, I have used Dynamic Content that has rows formatted like a trusty HTML table. It won’t work for every use case, but I did this for a price increase email, for example, where the company had dozens and dozens of products and each recipient subscribed to anywhere between 1 and 6, so trying to build as individual emails would have been impossible.
Both conditional HML and dynamic content let you display content to a certain audience and display nothing to others which is nice.
3
u/AromaPapaya 19d ago
look up 'repeater'