All things Shopify and commerce
I'm attempting to create a Flow that's triggered by a product added to store, checks for a color tag such as "primary-black", then updates the metadata of that product to Black.
I created a color metaobject that utilizes a title, hexcode, and .jpg when included.
I used the method that is described in the attached video starting at 6.45.
Thanks, I had to adjust the code with a little to get Flow to not throw an error (I'm no coder, had to do a bit of research). Unfortunately, even after Flow accepted the code, after running it I get this error, "Got error updating metafield: "Value can't be blank." For value: "\n\n", Type: list.metaobject_reference".
Here's the updated code:
{% if product.tags == "primary-black" %}
{{ product.tags | replace: "primary-", "" }}
{% endif %}
{% assign product.metadata.color = "Black" %}
Should I be adding each detail from this metaobject; the color name, the hexcode, and whether or not there's a jpg?
You generally can't set metafields to an empty value.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025