How to check if item got restocked

How to check if item got restocked

MrDutch1
Tourist
3 0 0

I am using the trigger ‘product variant inventory quantity changed’ in shopify flow.

i already figured out that InventoryQuantityPrior is available. Now I want to just check if InventoryQuantityPrior is less than the current inventory at the location it was restocked.

 

there’s already a trigger that checks if it goes from less than 1 to more than 0. However, sometimes our stock is negative and we want to know if something got returned that has a negative stock.

 

we don’t want to get notifications when the stock is reduced. 

any ideas? basically I’m looking for a trigger “restocked” even if the stock is less than 1 after restocking.

Reply 1 (1)

paul_n
Shopify Staff
1584 171 364

I suspect you can't use inventoryQuantity prior because that is for the variant and it's a naive sum of all the locations (even those that are minus). Which means that you would need to store the prior quantity at that location using something like a metafield or tag. Tags are easier if you have just one location you care about, whereas metafields could work for many locations. Here's a template using tags to do something like this: https://shopify.com/admin/apps/flow/editor/templates/f310fc68-64c7-4234-91ea-888555a3ab8e  

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.