I am attempting to create a Flow that updates an Order’s metafield with a value from Company Location. The intent is to capture a Bill To Email on orders.
The trigger is Order Created
The Action is Update Order Metafield
Metafield namespace: custom
Key: bill_to_email
Value: I am attempting to pull in a metafield value from Company Location. This seems to pull the correct value.
{% for metafields_item in order.purchasingEntity.PurchasingCompany.location.metafields %}
{{metafields_item.value}}
{% endfor %}
Type: Single line text (Both the source and target metafields are also single line text)
The correct value is pulled however it returns the following error.
Got error updating metafield: “Value must be a single line text string.” For value: “\n kara@tinkercoffee.com\n”, Type: single_line_text_field
SOLVED: This thread solved the issue and removed the /n.