# Import & Export

Canonical: https://useformwork.com/docs/entries/import-export

Create and update entries from CSV, and export the exact result of a saved view.

Imports and exports run as background jobs. Their progress, outputs, and error reports appear in the form's **Files** tab.

## Export a saved view

1. Open the form's **Entries** tab.
2. Select or build the view you want.
3. Select **Export**.
4. Review its name and column preview.
5. Select **Export CSV**.
6. Download the result when the job completes, or find it later in **Files**.

The view determines:

- Which active entries match
- Which references become columns
- Column order
- Resolved CSV header labels

CSV is the only current export format. Create a dedicated view when you need a stable recurring report.

## Prepare an import

Select **Import** to see a copyable header row built from every field ID in the form's current version, including nested field definitions. Create a CSV with exactly one header per column and the same number of values on each row.

```csv
first_name,email,quantity
Alex,alex@example.com,2
Sam,sam@example.com,5
```

Values are interpreted according to the target field type where supported. Unknown headers do not create fields and will not appear as normal answers. Use only the template's exact field IDs, then review the resulting entries and validation state after importing complex or repeated data.

## Create or update

Rows normally create entries. To update an existing entry, add an `id` column containing its exact FormWork entry ID:

```csv
id,first_name,email
ENTRY_ID,Alex,alex.new@example.com
,Sam,sam@example.com
```

- A matching ID updates that entry.
- A blank/missing ID creates an entry.
- An ID from another account or form fails that row.
- An ID that does not exist is ignored and a new entry is created with a new FormWork ID.

The import template does not include `id` automatically; add it only for intentional updates.

## Run and review

1. Choose **Select CSV File**.
2. Select **Import CSV**.
3. FormWork uploads the source as a private admin-import file and starts the job.
4. Watch row progress.
5. Review succeeded and failed counts.
6. Download the error report when failures exist.

A job may be pending, processing, completed, or failed. A completed job can still contain failed rows; those are listed in its report.

Rows fail for conditions such as malformed CSV shape, invalid target entry ownership/form, or a write error. A written row can still leave ordinary form validation errors because import persistence is not the same as respondent submission.

## API operations

Automations can use the same flow:

```text
POST /api/v1/exports        { "view_id": "…", "format": "csv" }
GET  /api/v1/exports?form_id=…
POST /api/v1/imports        { "form_id": "…", "file_id": "…" }
GET  /api/v1/jobs/{job_id}
```

Authenticate with an account [API key](/docs/platform/api-keys). For import, upload the CSV using the file operations in the interactive API reference, then pass its `file_id`.

## Safe bulk changes

- Export the target view before an update import.
- Test a few representative rows first.
- Use field IDs, not labels, as import headers.
- Preserve exact entry IDs and never copy them between forms.
- Review validation errors after the job.
- Imports create/update draft data without firing Entry Created or Answer Updated workflows; start any required downstream process separately.
- Re-import only corrected failed rows to avoid duplicate creates.

For view construction, see [Views & Filtering](/docs/entries/views-filtering).