Adding fulfillment location for each line item in Shopify Flow Email

We ship from a single location but have multiple warehouse locations. Using an order routing app we are able to split and tag the orders. Using the tags I set up a flow to send an internal email to the assigned stores based on the Order Tags. The trouble I’m having is when I try to add the assignedLocation variable, it’s duplicating products.

This is what I have:

{% for fulfillmentOrders_item in order.fulfillmentOrders %}
 {% for lineItems_item in fulfillmentOrders_item.order.lineItems %}

{{lineItems_item.vendor}} - {{lineItems_item.name}} - SKU: {{lineItems_item.sku}} (Qty: 
 {{lineItems_item.quantity}} 
{{fulfillmentOrders_item.assignedLocation.name}}

{% endfor %}
{% endfor %}

But the output for an order with only line items is:

Vendor1 - Product1 - BLACK / S - SKU: ### - x 1 at Location1

Vendor2 - Product2 - YELLOW / XS - SKU: ### - x 1 at Location1

Vendor1 - Product1 - BLACK / S - SKU: ### - x 1 at Location2

Vendor2 - Product2 - YELLOW / XS - SKU: ### - x 1 at Location2

What do I need to do so the location is associated to the product and not being amended? Any help would be greatly appreciated! Thanks!

1 Like

Figured it out! Guess I needed to ask for help.

I was incorrectly using lineItems under Order and not under fulfillmentOrders in case anyone else is stuck in the same spot

Great, glad you figured it out Lexi7!

I’m running into a similar issue. Would you mind sharing variable exactly as you have it now? I’m struggling to find the correct one still

I think she means: order / fulfillment orders / lineItems