What's your biggest current challenge? Have your say in Community Polls along the right column.

Build a flow for when out of stock items are ordered

Build a flow for when out of stock items are ordered

GeorgiaKit2010
Visitor
2 0 0

We are in the process of trying to build a Shopify Flow that will send an internal email when an order is created containing at least one product that is out of stock/unavailable.
For context, we have quite a few products set to continue selling when out of stock. So when one of these items are ordered, it would make our processes much easier if this could be flagged and identified through an internal email.
So, ideally the flow would check whether the line items of an order has an inventory level of less than 0, and if so, trigger an internal email containing the order number, and the items that are out of stock.

We have looked at the conditions available after the trigger Order Created, but we are not sure/cannot find what we need to create this. Any help or insight would be much appreciated.

Replies 2 (2)
GeorgiaKit2010
Visitor
2 0 0

Hi @Ademola21 ,

Thank you so much for your response and the breakdown on how to build this flow.

For the 2nd step, creating the condition to check inventory levels, do you know which condition option I should select in order to do this? I have taken a look and found this one lineItems_item.variant.inventoryQuantity. Would this be the right one to use?

Thank you again for replying - I truly appreciate it!

Yuka
Shopify Partner
6 1 0

Hi, You are correct, you need to focus on `order.lineItems.variant.inventoryQuantity`.

You can check the order with the following condition:
CleanShot 2024-11-16 at 23.02.14.png

 

Then you can send then an internal email with the following message as example:
Order: {{order.name}}

Out of stock items:
{% for line in order.lineItems %}{% if line.variant.inventoryQuantity < 0 %}
- {{line.title}} (SKU: {{line.sku}}), quantity: {{line.variant.inventoryQuantity}})
{% endif %}{% endfor %}
Let me know if you have any questions about my proposed solution.