I’m attempting to set up a workflow and running into some trouble.
We are a clothing brand and many of our products have varying shades of colors (i.e. light blue, dark blue, etc.), so we’ve created a metafield to include a general color for each variant (ie. Blue) so that our filter just shows these generalized colors instead of every shade available (a filter will show “BLUE” but the results will show light blue, dark blue, etc.)
I want to create a workflow so that when a product is added, if the variant includes the word “blue” (ie. the variant color is light blue), the metafield will auto-populate to 'Blue" so that we don’t have to manually input this for each product.
Attached is an example of what I’m hoping to achieve. You’ll see the variant color in the description is “Dark Orange”, but the color metafield says “orange.” I am hoping to auto-populate this.
Any help would be much appreciated!
I hope you are using Shopify flow (https://apps.shopify.com/flow). I could successfully setup a workflow as you described in my test store. Here are screenshots:
1 Like
This is very helpful, thank you Suman!
Hi Suman,
I’m running into an error with my flow.
My variant metafield is set up as single line text that is limited to preset choices, and more than one can be selected (for example, if it is a blue patterned shirt, you can select “blue” and multi". I have set up my workflow to look like yours, but when I run it I am getting this error:
Got error updating metafield: “Value is invalid JSON: unexpected token at ‘Blue’.” For value: “Blue”
I think this error is happening because the metafield has present choices and you can choose multiple, it’s not a simple single line string (even though one of the valid input values is “blue”).
Is there a different way I should be setting up the metafield type in the flow? I also tried to do “List of single line strings” and “JSON” but I got the same error.
See screenshots below:
Thanks in advance!