Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
<b>ORDER DETAILS</b>
Order ID: {{order.id}}
Order Number: {{order.name}}
Customer name: {{order.customer.displayName}}
Shopify customer id: {{order.customer.id}}
Customer company:
Customer email: {{order.email}}
<b>ITEM DETAILS</b>
{% for lineItems_item in order.lineItems %} {{lineItems_item.name}}{% endfor %}
{% for lineItems_item in order.lineItems %}
{% for metafields_item in lineItems_item.product.metafields %}
{{metafields_item.value}}
{% endfor %}
{% endfor %}
<b>ITEM DETAILS TESTING</b>
{% for metafields_item in lineitems_item.product.metafields %}
{% if metafields_item.key == "custom_fields.template" %}
{{ metafields_item.value }}
{% endif %}
{% endfor %}
Hi
It looks like you're missing a loop around the last block of code. It should look like:
{% for lineItems_item in order.lineItems %}
{% for metafields_item in lineItems_item.product.metafields %}
{% if metafields_item.key == "custom_fields.template" %}
{{ metafields_item.value }}
{% endif %}
{% endfor %}
{% endfor %}
Also of note, the initial snippet you posted used the variable `lineitems_item` instead of `lineItems_item` (capitalization on the second `i` is mismatched) so that is fixed too.
Hope that helps!
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025