Re: Customer Metafield update in Shopify Flow

Solved

Customer Metafield update in Shopify Flow

ahmad_al_hamwi
Excursionist
13 0 7

I am trying to capture customers' Birthday through custom fields in the create account page, where it works, but the data is stored in Customer Notes as this "Birthday: 13-10-2022" 

 

I wish to extract the "DD-MM-YYYY" format and place it in a predefined customer Metafield that is called birthday. 

 

I was trying to use the variable {{customer.note}} and remove first "Birthday: " like this: 

Metafield value = { {{customer.note}} | remove_first: "Birthday: " } 

 

Please see attached photos. It is not working, and I think this value shall be deeper in code, which am not that good at. I appreciate the support and any other solution is more than welcome. 

Accepted Solution (1)
thejustintharpe
Explorer
59 8 11

This is an accepted solution.

Clear the value field completely and paste this in it...

 

{{ customer.note | remove: "Birthday: " }}

 

Please let me know if it works.

Please Like and Mark as Solution if Helpful.
Try for Free. The Most Supportive Product Page Modifier App

Apps Specialist

View solution in original post

Replies 8 (8)

thejustintharpe
Explorer
59 8 11

Hi @ahmad_al_hamwi 

 

Ideally, I think this should be saved inside the order itself. In the order meta fields or order notes.

 

Have you considered trying that? And how are you actually saving this in customer, I mean is it through an app? In which case - have you checked if the app has the option to customize how you want to save it?

 

Hope this helps!

Please Like and Mark as Solution if Helpful.
Try for Free. The Most Supportive Product Page Modifier App

Apps Specialist
ahmad_al_hamwi
Excursionist
13 0 7

Hey @thejustintharpe,

 

thank you first for your reply. 

what am referring to does not have to be related to any order. It is regarding customers metafields. 

am already capturing the Birthday in the customer's notes, but i just need to transform this from notes to metafields.

thejustintharpe
Explorer
59 8 11

Ok. I think I kind of understand what you're talking about.

 

So I'm assuming you're on the Shopify Plus plan and are using automation for some stuff.

 

Please provide a bit more information on how you setup those - did you do it manually via theme code (maybe a developer helped you), or did you use an app from the Store?

 

Because then only I could dig deeper to try to find a solution.

Please Like and Mark as Solution if Helpful.
Try for Free. The Most Supportive Product Page Modifier App

Apps Specialist
ahmad_al_hamwi
Excursionist
13 0 7

Thank you for your support! 

Yes, I did it through custom code in the customer registration liquid. The information is being transmitted correctly, the issue is only am not able to change this text "Birthday: 13-10-2022" in notes, to the customer metafield that I defined. 

Yes am using flow, but am not on shopify plus, as flow is now available for almost all shopify plans. Please check the screenshots i used in the original post as they show what am intending to do, and where the code shall be updated. 

 

I will include here a screenshot as well, as in my opinion, I shall be able to place a code here (see screenshot) that allows me to modify/extract characters out of the variable {{Customer.notes}}. 

As mentioned, I do not need assistance capturing the information, but only transforming them to metafield. So from a text in {{Customer.notes}} to a specific customer metafield in the form of dd-mm-yyyy


thanks! 

thejustintharpe
Explorer
59 8 11

As far as I know, that can be done via the API. I don't think you can do it through your Shopify theme code.

 

P.S. I don't see any screenshots attached at all. Maybe it's an issue on Shopify's end. But please try sharing in the reply again if possible.

Please Like and Mark as Solution if Helpful.
Try for Free. The Most Supportive Product Page Modifier App

Apps Specialist
ahmad_al_hamwi
Excursionist
13 0 7

Ohh, did not know that you can not see the screenshots. They are for sure uploaded in the thread. 

I will try attaching them here again. 

 

Regarding the code for customer's birthday, it is already working. Am receiving customers' birthdays in customers' notes. I used the code here to do it: https://shopify.dev/themes/customer-engagement/additional-customer-information

 

Please let me know if the photos are not attached until now, as I can share them on a cloud in case this doesn't work. 

 

Screenshot 2022-10-09 132941.pngScreenshot 2022-10-09 133043.png

 

 

thejustintharpe
Explorer
59 8 11

This is an accepted solution.

Clear the value field completely and paste this in it...

 

{{ customer.note | remove: "Birthday: " }}

 

Please let me know if it works.

Please Like and Mark as Solution if Helpful.
Try for Free. The Most Supportive Product Page Modifier App

Apps Specialist
ahmad_al_hamwi
Excursionist
13 0 7

That simple! it works. This is exactly what I wanted. Thank you very much @thejustintharpe