Shopify Flow how do I check quantity for only individual variants on a order not parent product

Solved

Shopify Flow how do I check quantity for only individual variants on a order not parent product

BAdam
Tourist
4 0 1

Hi, 

 

I'm creating the following Shopify Flow to send an internal email if a SKU on an order is oversold. 

 

BAdam_1-1734566084458.png

However, I'm running into an issue where the flow is firing every time a product on an order is showing -1 stock, since our products have multiple variants, I only want the flow to check for stock levels of individual SKUs. The image below shows an example of the flow firing when I don't want it to, since the variant stock of -1 in this case isn't the SKU on the customer's order. 

 

BAdam_2-1734566417370.png

 

Any help or ideas would be appreciated.

 

Thanks!

 

 

 

Accepted Solution (1)

paul_n
Shopify Staff
1505 163 352

This is an accepted solution.

You are checking if at least one line item has a product where at least one variant <= -1. 

 

Change that to check:

if at least one order / lineItems / variant / inventoryQuantity <= -1

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

View solution in original post

Replies 6 (6)

Sonya_2025
Shopify Partner
316 36 57

Hi @BAdam 

Have a try like below

Sonya_2025_0-1734572989819.png

 

Please let me know if it works by giving it a Like or marking it as a solution!
Feel free to reach out.Get Shopify free trial 1$/mon
 EMAIL ME  Motivate me by  PAY ME
BAdam
Tourist
4 0 1

Hi @Sonya_2025,

 

I have set it to zero to see if the flow will target just the specific SKU on an order. But I'm not sure how this will solve it, because I only want the flow to fire when a SKU on an order is oversold. 

 

Currently, it will check the quantity of all the SKUs in a parent product and will pass the flow if it finds a variant with a quantity less then zero, even if the SKU he has in his order is over 0.

 

I hope that makes sense.

 

 

 

 

Sonya_2025
Shopify Partner
316 36 57

Hi @BAdam 

Pls pay more attention at the place I marked. It is different to your settings. 

Sonya_2025_0-1734581272705.png

 

Please let me know if it works by giving it a Like or marking it as a solution!
Feel free to reach out.Get Shopify free trial 1$/mon
 EMAIL ME  Motivate me by  PAY ME
BAdam
Tourist
4 0 1

Hi @Sonya_2025 ,

 

My apologies thanks for your help I'll give it a try!

 

Thanks

 

 

 

paul_n
Shopify Staff
1505 163 352

This is an accepted solution.

You are checking if at least one line item has a product where at least one variant <= -1. 

 

Change that to check:

if at least one order / lineItems / variant / inventoryQuantity <= -1

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
BAdam
Tourist
4 0 1

Thanks @paul_n appreciate the help