A user needed to automatically transfer customer data (gender and birthday) from Shopify’s customer notes field into customer metafields using Shopify Flow.
Initial Problem:
The original Flow attempt failed because notes contained multiple lines of data, and the automation couldn’t parse multi-line text into a date field
When tested with only birthday data, it worked successfully
Solution Development:
Contributors provided Liquid code to parse multi-line notes by splitting on line breaks and extracting specific fields
Key technical adjustments included:
Using lines.first and lines.last instead of array index notation (not supported in Flow)
Changing customer.notes to customer.note (correct syntax)
Adding hyphens in Liquid tags ({%- and -%}) to remove unwanted whitespace/newline characters
Using lstrip filter to clean remaining whitespace
Final Working Code:
For gender: {%- assign lines = customer.note | newline_to_br | split: '<br />' -%}{%- assign gender = lines | first | split: ':' -%}{{- gender | last | lstrip -}}
For birthday: Similar structure using lines | last
The issue was resolved, with users confirming the solution works for extracting both fields from multi-line customer notes.
Summarized with AI on October 29.
AI used: claude-sonnet-4-5-20250929.
I have customer information, gender, and birthday, in the customer note section and I’d like to add the info into the customer metafield section automatically.
I tried to do this with Shopify flow but it doesn’t work at all.
I noticed that your notes have multiple lines with different fields. Since notes is a text box, your automation will fail. The reason is that when you are trying to assign the result of getting the notes and removing ‘birthday’, the resulting output will be:
"gender:female
1992-07-08"
and this will not fit in a date shopify field. Can you try with just the birthday in the notes and see if it works that way?
In order to access the first and last element, you need to do this:
birthday | last
I’ve been trying the code and it works fine with the above-mentioned, except that for some reason, shopify adds some extra newlines characters. You will need a way to remove them in order to make this approach to work. for reference:
The tags themselves add newline characters. You can remove them by using hyphens in that tags. For example, this will remove whitespace before and after the opening {% and closing %}