Transform Customer tag to metafield birthday

Transform Customer tag to metafield birthday

David-Sobel
Shopify Partner
2 0 0

Hello,

I created a birthday field in a register form.
This field automatically feeds a customer tag e.g. "date-of-birth: 05/12/1983" .
To make better use of this data, I'd like to convert this tag into a "facts.birth_date" metafield with a Flow.

I've created my Flow but I don't know what information to enter in the fields below in order to transpose the date entered in the 05/12/1983 tag into the metafield.
- Metafield namespace
- Key
- Value
- Type


Best

Reply 1 (1)

paul_n
Shopify Staff
1336 151 305

I think you should know how to enter namespace, key, and type based on that `facts.birth_date` metafield ... that info should all be available from the Admin. 

 

To translate the value field, you can use liquid or the Run code action.

 

The date needs to be formatted in ISO8601 format. The shows help on how to convert dates https://shopify.github.io/liquid/filters/date/

 

To get that date out of your tag, you need to parse out the date-of-birth: part. You can use something like:

{{ tagname | remove:"date-of-birth: " | date: "%Y-%m-%dT%H:%M" }}
Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.