Shopify Flow (Update Product Metafield)

Hi guys! I would like to perform a task on Shopify flow but it keeps running forever without giving out a result and also it’s not doing the action at all.

First: I have created a custom metafield with definition into the products section (Namespace: quantity) (Key: incoming) (Type: Integer) (Available Storefront API)

In Shopify Flow I want to update this metafield when the inventory is updated. So I chose the trigger (Inventory quantity changed) then as an action → Update Product Metafield

But when running the workflow it keeps running and there is a loading animation that keeps rotating… no action… no error message. Plus, when I choose to tag metafields value into product it works… (so it means that Shopify flow has access to this metafield…)

Can you please help me with this? I provide screenshots.

Thank you!

We think we found an issue with your account and have fixed it. The workflow that was failing appears to have successfully completed.

1 Like

Yes now it works!!! Super great. I have only one problem right now…

When I put variable “incoming” into the metafield’s value it gives me this error. I don’t understand because this variable returns an integer and my metafield is type integer…

If you notice, you have white space around that, which means that 4 is actually a string, 4. Unfortunately with liquid you need to remove white space from your code so that it doesn’t output empty strings. I think it would work but just making that last “if” statement inline, and making sure there are no newlines after the code block

Hi Paul,

Thanks again for helping me!

I tried to put on the same line and does not work.

I tried filter (strip) does not work.

I tried filter (remove " ") does not work

I will try some other things and will let you know!

It works!!!

I’ve put everything inline … The whole code :slightly_smiling_face:

Thanks again Paul !!!

Hi Paul!

My account seems to do the same problem again… you guys fixed it well but now it repeats retrying to update the metafield!

Can you please help me please?

It looks like this was resolved?