Import data from a spreadsheet
Data Import creates many documents at once from a CSV file, an Excel file, or a Google Sheet. Use it to load masters, such as Customers and Items, during setup or migration. To change documents that already exist, see Update existing documents with Data Import.
Prerequisites
- The Import permission on the document that you import. System Managers have it.
- Your data, cleaned and in one spreadsheet for each kind of document.
- Linked records exist first. For example, import Customer Groups and Territories before Customers.
Step 1: Create a Data Import
- Open the Data Import list and select Add Data Import. Or open the list of the document, for example Customer, and select Import from the menu.
- In Document Type, select the document, for example Customer.
- In Import Type, select Insert New Records.
- Save.
Step 2: Download the template
- Select Download Template.
- In Export Type, select Blank Template. To see how existing data looks, select 5 Records instead.
- Select the File Type: Excel or CSV.
- Select the fields to include. Mandatory fields are marked with a red asterisk. Select Select Mandatory to select all of them. A field with an info icon is needed only in some cases; point at the icon to read the note.
- Select Export.
Fields marked Include in Import Template in the document or in Customize Form are selected by default.
Step 3: Fill the template
- Enter one document in each row.
- Leave the ID column empty. ERPNext names each new document.
- For a link field, enter the exact name of an existing record.
- Save the file as Excel or CSV. For CSV with non-English text, save it with UTF-8 encoding.
Rows of a table inside a document
Some documents have tables, for example the Items of a Sales Order or the prices of an Item. In the template, put the first table row on the same row as the main fields. Put each next table row on its own row, and leave the main columns empty. ERPNext adds those rows to the document above.

Step 4: Attach the file
Choose one:
- From a file: select Attach in Import File, then upload from My Device, pick a file from the Library, or give a Link to a file online.
- From Google Sheets: copy your data into a Google Sheet, set its sharing to public, and paste its link in Import from Google Sheets. To check that it is public, open the link in a private browser window.
Step 5: Check the preview and import
- ERPNext checks the file and shows a Preview and the Import File Errors and Warnings. Each warning names the row or the column.
- If a column does not match a field, for example because you renamed it, select Map Columns and choose the field for each column. Or select Don't Import for a column.
- Fix all warnings in the file and attach it again.
- Optional: select Submit After Import to submit documents such as Sales Orders after they are created.
- Keep Don't Send Emails selected so that notifications are not sent for each new document.
- Select Start Import.
The Import Log shows each row and the document created from it. If some rows fail, the status is Partial Success. Select Export Errored Rows, fix those rows, and import them again.
Tips for large imports
- There is no fixed limit, but import a few thousand rows at a time. A very large import, such as 50,000 rows, slows ERPNext down for other users.
- See Avoid naming series lock waits when you import many transactions at once.
Troubleshooting
Duplicate name
A document with the same name already exists. Remove the row, or change the value that the name comes from.
Columns cannot be matched
You added or renamed a column. Select Map Columns and map each column to a field.
Link validation failed
A value in a link field does not exist. Create the linked record first, or correct the spelling.
Import timed out
Select Retry. If it fails again, split the file into smaller files.