This seems like it should be simple but I’m not getting any success, and haven’t found anyone else with this problem.
All I’m trying to do is: When an order is created, add the tags associated with that Customer to that order. For example, if the Customer has the tag “Wholesale”, then the order automatically gets populated with the tag “Wholesale”
My flow:
-
Start When: Order Created
-
Add order tags: {% for tags_item in order.customer.tags %} {{tags_item}} {% endfor %}
I get the error: “Order tags is invalid”
Can anyone point me to what I’m doing wrong? Thanks!
UPDATE: This seems to be an issue only if the customer has more than one tag. Customers with a single tag are working correctly. I tried adding the “For each” element but that did not work either.
I think this might be the issue: the “Add order tags” action in Shopify Flow expects a list (array) of strings, not raw Liquid template code. When you input:
{% for tags_item in order.customer.tags %} {{tags_item}} {% endfor %}
you’re generating a single string of space-separated tags (or possibly invalid Liquid), rather than a proper list Shopify Flow can use. Try replacing it with:
{{ order.customer.tags }}
This should pass the tags correctly as an array.
That explains why it worked with one tag—your code outputs a single string, which Flow can handle, but it breaks with multiple tags since it’s not a proper array.
Thanks so much, this did the trick!