Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
I have two locations which can ship the same items. I use location-2 as an overflow if location-1 can’t ship the total quantity of a product, in those cases I might ship what I can from location-1 and mark fulfilled to trigger sending of this email to location-2 to ship the remaining quantity.
The Flow is setup like this:
Problem 1: I recently noticed that the table included the total quantity of a line item ordered instead of only the quantity assigned to location-2. I.e. the order has qty-5 of shirt; location-1 ships 3; the remaining two are moved to location-2; this email should then request location-2 only send the two. However the email requested all 5 instead of only the two which were assigned to location-2. I’m not sure how to further contain the line quantity to only those in the specific fulfillment at hand versus the total number ordered on the parent order item?
Problem 2: I recently had a customer change items on his order. I edited the order, removing some items and adding others. However the table included ALL of the items, both currently active and removed by the edit. Is there some if-condition check I can add to fulfillmentOrders_item.lineItems to exclude items that are removed and not included in the fulfillment request?
<table>
<tbody>
{%- for fulfillmentOrders_item in fulfillment.fulfillmentOrders -%}
{% comment %} Sort rows by title {% endcomment %}
{% assign lines_by_title = fulfillmentOrders_item.lineItems | sort: 'productTitle' %}
{% for line in lines_by_title %}
{%- assign line_quantity = line.lineItem.quantity | times: 1 -%}
{% comment %} Running count of fulfillment total items {% endcomment %}
{%- assign total_item_count = total_item_count | plus: line_quantity -%}
<tr>
<td>{{ line_quantity }}</td>
{% comment %} Supplier-sku metafield instead of SKU {% endcomment %}
<td>
{% assign supplier_sku = line.lineItem.variant.metafields
| where: 'namespace', 'inventory'
| where: 'key', 'sku_supplier'
| first
-%}
{{- supplier_sku.value }}
</td>
{%- capture variant_line -%}
{{ line.productTitle }}{%- if line.variantTitle -%}, {{ line.variantTitle }}{%- endif -%}
{%- endcapture -%}
<td>
{{ variant_line }}
</td>
</tr>
{%- endfor -%}
{%- endfor -%}
</tbody>
</table>
In both of these, it's not clear what you want to do, as the language isn't precise enough. Can you refine?
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