Skip to main content

I’m learning how to use dynamic blocks in flow emails, but my product data is not previewing correctly. I’d greatly appreciate your guidance.

Here’s my setup:

Row Collection: event.extra.line_items

Row Alias: item

Table Content: I have a table with two cells per row — one for the product image and one for product information.

Text Cell (dynamic content):
{{ item.ProductName }}
Type: {{ item.ProductType }}
Price: ${{ item.Price }}
Quantity: {{ item.Quantity }}

Image Cell (Dynamic Image / Dynamic URL):
{{ item.ImageURL }}
I have attached screenshots of my table block setup and preview. Despite using a test profile with items in the cart, nothing appears in the preview. I would greatly appreciate if you could review my setup and provide a working example so I can successfully preview my products in the table.

Thank you so much for your help!


 

 

Hi ​@Fiona Lu,

Thanks for providing this info and the screenshots! Judging from what you shared so far, this does appear like it would create a working table if the flow you built was triggered by Shopify’s Checkout Started event. What event do you have triggering this flow?

The reason this is important is because all events contain different event data, and variables you use like {{ item.ProductName }}, {{ item.Price }} ect, all pull information from the event’s data into the template. That being said, issues can arise if the variable you use doesn’t actually apply to that event’s data. For example, the Checkout Started event might have its product names inside the value {{ event.extra.line_items.ProductName }}, which allows {{ item.ProductName }} to pull from that piece of event data, when inside a dynamic table. But another event, like Added to Cart, for instance, might have item names under {{ event.ItemName }}, meaning that the variable you used doesn’t apply. In short, different events are like different languages, and you need to be using the correct language in each flow.

Another potential issue - you might be using a dynamic table when a static table works best. Dynamic tables are best for flows triggered by events with multiple items in them (like Checkout Started, Placed Order and Fulfilled Order). Static tables work best for flows triggered by events that correspond to a single item (Added to Cart, Viewed Product). The wording is a bit deceptive - static tables can still pull dynamic content into them as long as they have event data in them. If your flow is triggered by Added to Cart, you’ll want a static table instead.

I know this was a lot of information! Don’t hesitate to ask me any follow-up questions. Happy to answer.