Currently, we tag our products with various attributes for products, such as Category and Colour. These tags are prefixed with "Category: " or "Colour: " as an example.
We’ve got a flow setup where we want the flow to read the tags on the product extract ones that start with a prefix and add those in a list of single line strings.
Does anyone know how this can be achieved. These metafields will populate our filters on collection pages.
It only adds one value in the single line text metafield type, where as I want to have it as a list of single line strings and loop through all the tags for multiple colour tags.
I put the comma thing in the wrong spot. But the problem is that putting it inside the first if statement means you can’t use “forloop.last”. I used this code awhile back to solve the same problem. It assigns a comma separated list to a new variable and then strips the last comma and adds the square brackets. The “strip” parts removes any whitespace. The hyphens remove whitespace around the tags so it’s easier to read the code.
Only thing is we have tags that begin with Category: and Sub-Category: and it appears they’re chasing. Is there a way this can be altered so we don’t have to adjust all of our tags?
You’ll see in the Category metafield, it’s showing Sub-Romper