# How to import data from a file?

The **Data import** wizard loads rows from CSV or Excel into a new or existing table. Data is written only after **Preview before import** — until you confirm, you see a preview and can choose append or full replace mode.

## When you need this

- You need to move a directory from Excel or CSV.
- You want to refresh a table with a new set of rows from a file.
- You need to create a table directly from file columns.

## Key terms

- **Source** — step where you upload **File (.csv, .xls, .xlsx)**; the first row must contain column names.
- **Where to import** — existing table or **Create new model from import**.
- **Mapping** — match file columns to table fields.
- **Write mode** — **Add to current records** or **Clear model and import again**.
- **Preview before import** — preview table; button **Import {count} records** or **Delete {clearCount}, then import {importCount}**.

## Before you start

- [x] You are in **Menu → Custom Data**.
- [x] File is CSV, XLS, or XLSX; first row is column headers.
- [x] For import into an existing table — fields match file data (or you will map them on the **Mapping** step).

## Step-by-step

1. Open **Data import** — from the start screen (**From file (Excel/CSV)**), empty table state (**Import data**), or table toolbar (**Import**).
2. On **Choose import source**:
   - Select **File (.csv, .xls, .xlsx)**.
   - Upload the file — the system reads columns for next steps.
3. On **Where to import**:
   - **Import into existing model** — pick a table from the list.
   - **Create new model from import** — set **Model name**, **Description**, **Group**; review **Fields in the new model** (names and types from the file).
4. On **Match file columns to model fields**:
   - For each **Model field**, choose **Column from file**.
   - Optionally set **Default value** for empty cells.
5. On **Write mode** (existing table only):
   - **Add to current records** — new rows are appended; existing rows stay unchanged.
   - **Clear model and import again** — all current rows are deleted first; confirm in **Confirm destructive import**.
6. On **Preview before import**:
   - Check the summary (how many rows will be added or replaced).
   - Review the preview; fix **Invalid rows** if import is blocked.
   - Click **Import {count} records** or **Delete {clearCount}, then import {importCount}**.
7. On **Import result**, review the summary and click **View data** or **Edit model**.

## What happens next

Rows appear in the records table. A new table shows in **Tables**; an existing one is updated per the chosen write mode.

## How to verify

- On **Import result** — **Import completed** and expected **Inserted** count.
- In the records table — **Rows in table** matches the expected number.
- Invalid file rows were not imported (or you fixed them before import).

## Other options

- Import from Google Sheets — see [Import from Google Sheets](/en/customdata/how-to/import-from-google-sheets.md).
- Create a table from a file without a separate editor — choose **Create new model from import** on **Where to import**.

## Related guides

- [Import from Google Sheets](/en/customdata/how-to/import-from-google-sheets.md)
- [Create a table](/en/customdata/how-to/create-model.md)
- [View table records](/en/customdata/how-to/view-model-records.md)
- [Export model data](/en/customdata/how-to/export-model-data.md)
