Importing Customer Metafields

Solved

Importing Customer Metafields

DRChevalier
Shopify Partner
12 2 11

According to the Shopify Help documentation, not only can you create customer metafields but you can also use those fields as import fields when importing customers.  I cannot make this work.  I opened a ticket and was told that it would not work which is contrary to the documentation.  That ticket remains open with no activity over the last few business days.

 

If anyone has gotten this to work with the current (August 2024) release of Shopify, would you please share what you did and any tips you discovered to make it work?

 

Thank you kindly.

Accepted Solution (1)
DRChevalier
Shopify Partner
12 2 11

This is an accepted solution.

Hi Paul,

 

That's a good suggestion, I will do that and see what I learn, and update this post.

 

Thank you!

View solution in original post

Replies 11 (11)

blazeb2b
Tourist
7 1 0

from where are you importing the customers and metafields?

Everything you need to start selling to B2B customers. We are in a private beta and accepting upto 10 merchants for lifetime free access. Email beta@blazeb2b.com to get started!
DRChevalier
Shopify Partner
12 2 11
The import is a CSV file constructed using the Shopify template extended with the metadata field headers as per Shopify online documentation.
DRChevalier
Shopify Partner
12 2 11

The source for the import is a CSV file based on the Shopify template.  The additional columns have been added and named as per the Shopify documentation to import customer metafields, but the import function says that they are invalid.

PaulNewton
Shopify Partner
7536 666 1592

Any such customer metafields for importing must already exist in the admin

and be a specific type

https://help.shopify.com/en/manual/customers/import-export-customers#supported-metafields 

 

Also make sure the CSV itself is free of errors, otherwise be more exact with whatever error messages are showing and where and how.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


DRChevalier
Shopify Partner
12 2 11

Hi Paul,

The customer metafields do exist in the admin.  I followed the instructions exactly to create the column headers in the import CSV using the data from the naming from the customer metafields exactly.  In this scenario, all the metafields are single line text which is supported per the link that you provided.  The failure occurs during the Preview phase of the import where it says that the fields do not exist, even though they do.

Thanks for trying to help

PaulNewton
Shopify Partner
7536 666 1592

Have you tried exporting then reimporting the exact CSV shopify gives when it includes metafields to check your syntax

https://help.shopify.com/en/manual/customers/import-export-customers#supported-metafields:~:text=Opt... 

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


DRChevalier
Shopify Partner
12 2 11

This is an accepted solution.

Hi Paul,

 

That's a good suggestion, I will do that and see what I learn, and update this post.

 

Thank you!

DRChevalier
Shopify Partner
12 2 11

Hi Paul,

 

Thank you for the suggestion.  I discovered that the documentation was not completely clear.  Your idea gave me the full field names and the import worked as hoped.  

Thank you very much sir.

JoelofArc
Visitor
2 0 0

I attempted to export my customers but the custom metafield did not export. Do you have any more info since you got it to work?

 

edit: Nevermind, I finally figured it out

JasonP
Visitor
1 0 1

For all others playing at home.  I have dropped a few hours on this today.  The information is 'kind-of' in the documentation, but it is not as clear as it should be.  Things I learned.

 

I put the CSV columns in the exact order that the default fields and metafields columns are in, in the Shopify metafile settings and sample export CSV file.

The CSV column heading in your import file must have the exact syntax.  When I created one of the metafields, it was assigned an identifier of custom.customer_number  .  I assumed, incorrectly, that this would be the column heading for the csv import file, but I eventually discovered that the column heading had to be customer.metafields.custom.customer_number  , because I was importing into the Customer module. First trap for young players.

The second trap is that at the time that I was doing my importing and exporting, only six specific data formats out of the available 26 data formats for metafields are supported for importing and exporting to CSV files. (no, I don't understand why this is the case either - probably to support the external Shopify App community so you are 'encouraged' to purchase another App to support this usability). So, if your metafield is set up with a type other than Boolean, Date, Date and Time, Integer, Decimal, Single line text; then it will neither import nor export in the version of Shopify I am using at the time of writing.  Hopefully this will be remedied soon.

My Third mistake was related to the country codes. The ISO reference page provided shows three different options for each Country.  For example; Australia has AU, AUS or 036.  It would appear that Shopify only accepts the two digit version of the ISO codes.  I was using the three digit in my initial upload.

 

My next challenge is that I did three uploads, to get some corrected data in from my CSV file (one of the entries had multiple lines in one of the metafields, which Shopify does not currently allow.  Even though I decided to not overwrite customers existing records, somehow, Shopify imported eight customer records instead of one; thereby duplicating seven records which I now need to find - an annoying task in itself, because I cannot seem to sort the customer records by customer name - I am still trying to mentally come to terms with this.  I can only assume I am getting something wrong.

 

Finally, a simple suggestion for Shopify Developers - If you look back to pre-1980's computing practices, you will see this really neat trick for importing date into an existing database.  It involves a processing called "mapping".  Try to stay with me here; what you do is, when the user uploads a file, you present the user with a list of the available fields in your database  (the fields to which data can be imported) and then next to each of those fields you have a dropdown box of all the available fields from the CSV import file, and, you have preselected the field you feel most likely corresponds to the relevant field in your database, or you have left the dropdown box blank if it is unclear what the mapping should be.  The user can then leave a dropdown box blank - that field is not being imported, agree with the preselection already made - well done Shopify AI, or select another field from the dropdown box to match the existing database field with the field (column name) being imported from the CSV.  Of course, data type checks can be done to warn a user that they are trying to import a URL into a Date field, or text in to and integer field, and so on.  Grab any computing book from the 1980's; it will be in there somewhere.  And while you are at it, would be great to increase the number of supported metafield types, preferably to 26.

 

Other than that, enjoying my learning process.

JasonP - Shopify newbie
David168
Tourist
4 0 2

thank you for clarity on the metafield setup. I was having a similar issue. Do you have any tips for matching up customer order data to imported customers?