Goal: Tag newly created orders with a customer metafield value using Shopify Flow and Liquid.
What was tried: A Liquid loop over order.customer.metafields to find a specific namespace and key, then output the metafield value as the tag. Initial snippet had issues: invalid variable name (mf.value), missing endif, and syntax inconsistencies.
Corrections proposed: Use the loop variable consistently and include the endif. Output should reference the exact loop variable’s value (metafields_item.value). Ensure namespace and key match the intended customer metafield.
Current status: Flow runs show “succeeded” but the order tag is not appearing. A screenshot was shared indicating success status without tags.
Likely cause: A remaining typo or variable mismatch (using metafield.value instead of metafields_item.value) preventing the value from being emitted for the tag.
Key terms:
Metafield: Custom key-value data on customers identified by namespace and key.
Liquid: Shopify’s templating language used in Flow to generate dynamic values.
Outcome: No confirmed resolution yet. Action items: fix the variable name and syntax, verify namespace/key, and re-run the Flow to confirm the tag is created.
When a new order is created , the order to be tagged with a Customer Metafield value.
Currently trying the following ,and although on the flow app it says that it’s successful, the tag with the metafieled value is not added on the order.
I currently use :
{% for metafields_item in order.customer.metafields %} {if {metafields_item.namespace==“namespace” and metafields_item.key == “key” }},{ mf.value }{% endfor %}
Appreciate your response Ethansz.
However, although the recent runs on the flow app say have the status: succeeded ,no tags are created on the order from the desired customer metafield value.