多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
2.7 KiB

---
title: 'Import CSV'
description: 'Import data from CSV files into NocoDB'
tags: ['Extensions', 'Import', 'CSV', 'Data Import', 'Data']
keywords: ['Import CSV', 'Import data', 'CSV import', 'Data import', 'CSV files']
---
## Overview
The Import CSV Extension in NocoDB allows users to import data from CSV files directly into existing tables. This tool helps in adding new records, updating existing ones, and efficiently mapping CSV columns to NocoDB fields.
## Importing Data
### Mode
The Import CSV Extension supports two modes of data import:
- **Add Records**: This option adds all records from the CSV file as new entries in the specified table.
- **Merge Records**: This option updates existing records based on a specified field (referred to as **merge field** in this context) in the CSV file.
2 weeks ago
- *Create New Records Only*
- Only adds new records from the CSV. Existing records are not updated. New records are identified based on the merge field specified.
2 weeks ago
- *Update Existing Records Only*
- Only updates records that already exist in the table based on the merge field. New records are not added.
- *Create and Update Records*
- Adds new records and updates existing ones as needed. New and existing records are identified based on the merge field.
**Merge Field** is field that will be used to match records from the CSV file with existing records in NocoDB table for the purpose of updating.
2 weeks ago
**Field Mapping:** You can select the fields from the CSV file to import and map them to the corresponding fields in the NocoDB table.
### Steps
2 weeks ago
To import data from a CSV file into NocoDB, drag-drop (or upload) the CSV file into the extension area and follow these steps:
1. Select the table you want to import the data into. By default, current active table is selected.
2. Select the mode of import: **Add Records** or **Merge Records**. If you choose Merge Records, you will have to additionally
- Select "Import Type" :
- *Create New Records Only*,
- *Update Existing Records Only*, or
- *Create and Update Records*.
- Select "Merge Field". Merge field typically will be your Primary Key or a unique identifier. Composite keys are not supported.
2 weeks ago
3. **Use first record as header**: If the first row of the CSV file contains the column headers, enable this option to use them as the field names.
4. Map the CSV columns to the NocoDB fields.
5. Click on the **Import** button to start the import process.
![Import CSV](/img/v2/extensions/upload-csv.png)
Once you've configured the import settings and mapped your fields, NocoDB will process the CSV file and update the table according to your specified settings. A summary of new, updated, and unchanged records will be displayed at the bottom of the interface.