Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi,
I want to create a flow where products that are on Draft and have more than 0 stock are put back on Active. But as extra condition, I want to make it check if certain values are not filled in a metafield. I can't make the flow values match the orginal ones. They are never recognised, so I need some help to formulate the right value in the flow so it matches. The values in the metafields are list items, 3 of those values if filled in should stop the flow, these list items are:
I provided a screenshot below (can't seem to add export of the flow?). I tried many other things, this is just the latest example of one that doesn't work. Tried both with string and JSON values. I'm not a coder at all, so I think I'm just missing the right way to input the values?
Thanks in advance!!!
Solved! Go to the solution
This is an accepted solution.
Don't loop over metafields like this. If any one of them has a large value, it can stop your automation from working, because you'll hit an API limit.
Instead you add the metafields individually to the workflow and then you can check the value for a single metafield. To do that, you choose "product / metafield" not "Metafields" plural. Instructions https://help.shopify.com/en/manual/shopify-flow/concepts/metafields#get-metafield-data
Hi @Kilian_A ,
Since your metafield is a list of values, each value is stored as a separate string item, not as one large JSON string.
Rather than comparing against a full JSON string (like ["Draft - Out of Stock (Shopify stock incorrect)"]), you need to check whether any list item matches one of the blocked values, like this:
In your third condition block, change it to:
IF: Any of product / metafields
Metafield list item value → is equal to → Draft - Out of Stock (Shopify stock incorrect)
Click Add criteria
Metafield list item value → is equal to → Draft - Quarantine
Click Add criteria
Metafield list item value → is equal to → Draft - Unsendable Products (food, glass, ...)
Change the condition mode to OR between them
Then under "If true", use Fail workflow
Under "If false", continue to set product to Active
Please try this once and do let me know if issue persists !
Thanks !
Hi,
Should I keep using the "json value" or switch to "string" again like the screenshot?
Here I tried your recommendations with the "json value" still and that didn't work.
This is the output of the condition for a product that had the "Draft - Quarantine" filled in the metafield:
["Draft - Quarantine"] is added after the "," each time at the end (cut of in the screenshot and can't have it shown in flow for some reason)
Hi @Kilian_A ,
From the screenshots:
Your metafield values are stored like this: ["Draft - Quarantine"]
But Shopify Flow evaluates each item in a list individually when you use the correct field, not json value.
What to do instead:-
Use:
Field: product / metafields
Condition Type: Metafield list item
Comparison: is equal to
Value: Draft - Quarantine (exact plain string, no brackets or JSON)
Then repeat the condition with OR for:
Draft - Out of Stock (Shopify stock incorrect)
Draft - Unsendable Products (food, glass, ...)
Final Condition Block Setup
IF → Any of product / metafields
Metafield list item is equal to Draft - Out of Stock (Shopify stock incorrect)
OR
Metafield list item is equal to Draft - Quarantine
OR
Metafield list item is equal to Draft - Unsendable Products (food, glass, ...)
Don’t use json value, that is meant for comparing raw JSON arrays, and your flow won’t match individual list items properly using that.
After setting this up:
Add a product with only Draft - Quarantine in the metafield
Change stock to trigger the flow
It should now match and block the flow
Let me know your metafield’s namespace and key (e.g., custom.status_blocking) if you want me to show exactly where to apply this.
Thanks !
Hi Steven,
Got it fixed with the recommendations of another comment.
Appreciate you willing to help though!
Cheers
This is an accepted solution.
Don't loop over metafields like this. If any one of them has a large value, it can stop your automation from working, because you'll hit an API limit.
Instead you add the metafields individually to the workflow and then you can check the value for a single metafield. To do that, you choose "product / metafield" not "Metafields" plural. Instructions https://help.shopify.com/en/manual/shopify-flow/concepts/metafields#get-metafield-data
This worked like a charm!
I have stumbled on it before, but I was a bit lost with the Alias before, now it made sense.
Thanks!!!
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