Inventory Quantity Prior for Selected Location

Hello I am struggling to trigger changes in inventory for a particular location. Is that possible?

It seems the Inventory Quantity Prior will only ever take into account total inventory.

Am I asking the impossible? Or is there a way around it? The data must be stored somewhere!

Thank you

Use templates to help. Here’s one, but there are a few there for different use cases: https://shopify.com/admin/apps/flow/web/editor/templates/fe0ecc27-6512-42c8-8bda-b56e06d77323

I have the exact same issue. We use this as a trigger for internal transfers, but as it stands we’ve always had to manually check every week. We would love to be able to use flows to trigger an email but so far I can only get it to take into account the total inventory which seems strange. The info is in Shopify, it even tracks what’s on hand vs. available, this is all great info, I just can’t figure out how to access it.

Have you looked at the templates? There are I believe 3 different templates that show how to work with location-based inventory.

1 Like

I in fact did look, but when you hit browse all apparently it doesn’t actually bring them ALL up. It looks like for me it’s just bringing the first 25 but no way to browse the rest of anything to indicate there are more. I browsed all that were present and there was nothing. But now at your suggestion I’m searching for “location” and a bunch of different flows show up and one that is EXACTLY what I’m looking for. Thanks!

Hello @Nomadica

May I ask what flow you ended up using?

Kind regards,

Nathan

I realize this is an old thread, but I struggled with the same issue and finally found a solution that may help. I figured out how to send an internal email notification when at least one location (of several) has fewer than X units of a product variant in stock. The email also prints the inventory breakdown by location for that specific product variant, looping through all of the locations you want to check. Sharing here in case it helps someone else and saves them time!

Flow config:

Code for Message body of internal email alert:

Show More

{%- assign location_ids = “gid://shopify/Location/32270856,gid://shopify/Location/73659416765” | split: “,” -%}

At least one warehouse has less than 20 units of the below SKU available in stock, please check.

SKU: {{ productVariant.sku }}

Product: {{ product.title }}

Variant: {{ productVariant.title }}

{% for location_id in location_ids %}
{%- assign matched_quantity = “” -%}
{%- assign location_name = “” -%}

{% for inventoryLevels_item in productVariant.inventoryItem.inventoryLevels %}
{% if inventoryLevels_item.location.id == location_id %}
{%- assign matched_quantity = inventoryLevels_item.available -%}
{%- assign location_name = inventoryLevels_item.location.name -%}
{% endif %}
{% endfor %}

Location: {% if location_name != “” %}{{ location_name }}{% else %}Not Found for ID {{ location_id }}{% endif %} - Inventory Quantity: {% if matched_quantity != “” %}{{ matched_quantity }}{% else %}N/A{% endif %}

{%- unless forloop.last -%}

{%- endunless -%}
{% endfor %}

Note:

  • Replace the location IDs with the locations you want to check, add more if necessary
  • Edit alert message “At least one warehouse…” to suit your use case
1 Like