Trying to modify Get product data query to include items out of stock from a specific location only

A-Spice-Affair
Tourist
3 0 1

Hi,

 

Would greatly appreciate your help in the following.

 

I'm trying to set up a Flow that would send an email summary every day showing products out of stock that meet the following conditions:

 

inventory_total:<=0 AND status:active AND tag_not:DISCONTINUED AND out_of_stock_somewhere:A Spice Affair's Factory

 

inventory level: working

status: working

tag_not: working

out_of_stock_somewhere: not sure if this is even the right variable to be using.. or if there's another way to do this

 

I am not sure how to set up the last condition, which is to search for inventory in a specific location only.

The flow is practically useless if it shows me ALL locations.

 

Here's the full flow:

Screenshot 2024-03-27 at 3.10.42 PM.png

 

 

 

 

 

 

 

Here are the details of the second step which is where I need help please. The rest is all functional.

Screenshot 2024-03-27 at 3.14.02 PM.png

I would appreciate anyone's help in the matter!!

Reply 1 (1)

DaveMcV
Shopify Staff
88 28 25

Hi @A-Spice-Affair,

 

I'm not an expert on that part of the API, but I think out_of_stock_somewhere is a boolean field and there isn't a way through the search query to check if a product is out of stock at a specific location.

You could add Code step after the Get product data step that acts like a filter and does the check for that location's inventory, passing down relevant data that can be used in the summary email. You would be subject to the 100 product limit of the data step but if you have less than 100 products that may work.

 

Hope that helps!

DaveMcV | Flow Development 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.