Update existing documents with Data Import ​

Use Data Import with Update Existing Records to correct or fill fields in many existing documents from a spreadsheet. ERPNext finds each document by the ID column and overwrites the fields in the file. It does not create new documents.

Prerequisites ​

  • The Import permission and the Write permission on the document.
  • A backup, or an export of the current data to go back to.

Step 1: Create a Data Import ​

  1. Open the Data Import list and select Add Data Import.
  2. In Document Type, select the document, for example Customer.
  3. In Import Type, select Update Existing Records.
  4. Save.

Data Import form with Update Existing Records selected

Step 2: Export the documents to change ​

  1. Select Download Template.
  2. In Export Type, select Filtered Records, and add filters to get only the documents to change. For example, filter Customers by Territory.
  3. Select only the fields to change. The ID column is always included.
  4. Select Export.

Step 3: Edit the file ​

  • Do not change the ID column. ERPNext uses it to find each document.
  • Change the values in the other columns.
  • Remove the rows that should not change.
  • Remove the columns that should not change. An old value in an extra column overwrites any newer value in ERPNext.
  • In a table inside the document, a row that you remove from the file is deleted from the document.

Step 4: Import the file ​

  1. Attach the file in Import File.
  2. Check the preview and fix all warnings.
  3. Keep Don't Send Emails selected unless you want update notifications.
  4. Select Submit After Import only if the documents must be submitted after the update.
  5. Select Start Import.

TIP

Import a few rows first and check the result. Then import the rest in batches. Keep the original export and the final file for your records.

Troubleshooting ​

ProblemFix
Record not foundThe ID column is missing or has a wrong value. Use the exact ID of the document.
Link validation failedA value in a link field does not exist or is misspelled.
Mandatory field missingA required field is empty in the file. Fill it, or remove the column.
Permission errorYour roles cannot change this document or field.
Field cannot be changedThe document is submitted and the field cannot change after submit.