Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Whenever I try to reference any metafield namespace (i.e. "inventory") under shop.metafields, the linter activates with error message:
"inventory" is invalid. Replace this variable.
However, I have confirmed that this namespace exists by rendering {{shop.metafields.inventory | json}} to one of my Shopify pages via Custom Liquid.
Why does this happen, and what can I do to access shop.metafields within Flow?
You cannot access metafields that way in Flow. The theme liquid does something special to be able to accept those metafield namespaces and keys in that format. In Flow, you currently need to loop over metafields like:
{%- for mf on shop.metafields -%}
{% if mf.namespace == "my_name" and mf.key == "my_key" %}{{ mf.value }}{% endif %}
{%- endfor -%}
Hello Paul,
Thanks for this solution! However, I think I do not get it to work.
Am I missing something or is it not possible to access custom metafields? See screenshot attached.
Kind regards,
Koen
mf.namespace == "custom" and mf.key == "maten"
That makes a lot more sense, thanks for the prompt reply
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025