I’m trying to run a weekly report to let me know if my Main Street has zero stock of any product variants, but my Broadway Ave store still has stock. So far I’m not even getting past running an initial query successfully. I’m using the Get product variant data or Get product data option and something like.. inventoryLevelMainSt:{available:0} inventoryLevelBroadway:{available:>=1} status:active inventoryItem:{tracked:true}
It doesn’t seem to be working… what’s a better way?
Quick check - is Main Street and Broadway Ave two separate Shopify stores, or two locations within one store? Changes the answer a lot.
If two locations in one store: Flow’s product search can’t filter on location-specific inventory like that. Field doesn’t exist. You’d need to search broader (status:active inventoryItem:{tracked:true}) then add a Get variant data step + Condition step that walks inventoryLevels, checks the location named “Main Street” has available == 0 AND “Broadway Ave” has available > 0. Works but Flow gets slow if you have a lot of SKUs.
Cleaner path: skip Flow, run a scheduled InventoryItems GraphQL query (Mechanic app handles this well, or a small app of your own). Pulls both location balances in one shot, easy to diff.
If two separate stores: Flow can’t see across stores at all. You’d need a flow in each store dumping snapshots to a shared sheet/S3/webhook, then a third process does the comparison. Or a multi-store sync app like Trunk handles it.
I don’t think Flow can handle inventory level filtering by location in the way you want.. Why not just use Analytics->New Exploration? Something like
FROM inventory_items
SHOW variant_id, product_title, variant_title, location_name, available
WHERE available = 0
AND location_name = 'Main Street'
AND tracked = true
SINCE -7d
Another approach is to use another Flow to run on “Inventory quantity changed” and set product/variant metafields like availability.Main-Street and availability.Broadway-Ave to true/false:
I don’t see how I’d be able to compare to see if my other location has stock with that, and eventually it’d be nice to automate it into creating a transfer as well. Thank you though.
FYI, today Flow is releasing a “Get analytics data” action that allows you to run Analytics queries from Flow on a schedule. Worth trying that once your shop has access to the action
The query syntax you are trying to use is failing because the Shopify search API does not support filtering by custom location names directly within the initial search string.
To build this correctly in Shopify Flow, you need to simplify your initial query in the Get product variant data action to just pull active and tracked items. After fetching that data, you must add a For Each loop to iterate through the results. Inside that loop, you can add a Condition block where you manually select the inventory level for your Main Street location and set it to exactly zero, combined with an AND rule checking that the Broadway location is greater than zero. Because Flow can sometimes be tricky with complex cross location inventory checks, a much faster alternative is simply exporting your inventory CSV once a week and applying a quick filter to those specific location columns in a spreadsheet.