Bench import-csv

How can I import a template for a specific site using “bench import-csv”?

bench --site your-site-name import-csv

1 Like

I downloaded the template with new fields from a site, but when I try to import the template in a new site an error message appears:

ValidationError: Please do not change the rows above Start entering data below this line

I want to update the template.

Welcome Ana -

The Data Import Template file lists this rule:

“Please do not change the template headings.”

In other words for an import to succeed, template headings must match DocType fields. The same applies to transfer data between sites - DocType definitions must match.

So to import data to the new site, first you need to manually update the DocType definition there?

But if I want to add new fields, what can I do?

I can import the template in the browser (Customize form), but not using bench …

Please more context details, you have me confused when you state for example

“I want to update the template.”

“I downloaded the template with new fields”

“if I want to add new fields, what can I do?”

So you have added or wish to add new fields to a DocType - which of these is your case here?

What document or forum post are you following - what is your goal and what have you done?

Thanks Ana!

Hi @clarkej !

I got the same problem.
So the story is the following:

I download the import template file from Import tool with 1 sample Item in CSV format.

Then I edit with Excel or CSV editor to hold the same headers and do not touch anything else in the file just the datas are added.

Now I uploaded the CSV file with the datas filled in. Nothing is changed in the header.

When I import, I get the same error messages that @Ana has mentioned.

So what can I do to import mass data in to the system?

I have checked the Format and the Code table too. Still no luck. Maybe you can tell me some other options to check.

Please let me know.

Thanks.

Regards. Gary

The importing is very sensitive to field/data types, so if you have, for example, a time string that looks like this “0.45678” instead of “11:45:23”, then the import will most likely fail. Saving out of excel often messes up the formats, so check all the columns to ensure that they match up, and then try again

3 Likes

Thanks @trentmu, you have right. I have found the problem in a date-time field type.
Corrected with standard CSV file without custom format in cells.