packages/twenty-docs/user-guide/data-migration/how-tos/prepare-your-csv-files.mdx
This guide walks you through preparing your CSV file for a successful import. Follow these steps in order to avoid errors.
Before you start, ensure your file meets these requirements:
| Requirement | Details |
|---|---|
| Format | CSV, XLSX, or XLS |
| Size limit | 10,000 records per file |
| Encoding | UTF-8 recommended |
| Structure | One object type per file |
<Note>For datasets larger than 10,000 records, split into multiple files or use the API import.</Note>
This is the most important step. The sample file shows you the exact column names and format Twenty expects.
<Note>Pro tip: Export a few existing records instead. This gives you real examples of how data should be formatted, and the column names will map automatically during import.</Note>
Twenty enforces uniqueness on certain fields. Duplicates will cause import errors.
| Object | Unique Fields |
|---|---|
| People | id, email |
| Companies | id, domain |
| Custom objects | id, plus any field you marked as unique |
Before importing:
<Warning>Soft-deleted records count toward uniqueness. Records in Command Menu → See deleted records will cause duplicate errors. Delete them permanently or restore and update them.</Warning>
Different field types require specific formats. Here's the complete reference:
[email protected]https://domain.comdomain.comhttps://domain.comPhone is a nested field requiring multiple columns:
| Column | Example |
|---|---|
| Phones / Primary Phone Number | 4159095555 |
| Phones / Primary Phone Country Code | US |
| Phones / Primary Phone Calling Code | +1 |
Address is a nested field with multiple columns (some can be left empty):
Use consistent formatting throughout your file:
YYYY-MM-DD (recommended): 2024-03-152024-03-15T10:30:00Z1234.561,234.56)Currency is a nested field requiring two columns that both must be filled:
| Column | Example |
|---|---|
| Amount / Amount | 1234.56 |
| Amount / Currency | USD |
Use uppercase: TRUE or FALSE
<Warning>Lowercase true or false will not work.</Warning>
Use the API name of the option, not the display label.
How to find API names:
OPTION_1, not "Option 1")<Note>New select options are not created automatically. Add them in Settings → Data Model before importing.</Note>
Use API names in array format:
["VALUE1","VALUE2"]
Use JSON array format:
["value1","value2"]
Use the format: RATING_1, RATING_2, RATING_3, RATING_4, or RATING_5
Fill both columns:
Twentyhttps://twenty.comFor secondary links, use the Links / Secondary Links column:
[{"url":"https://twenty.com","label":"Twenty"}]
Use valid JSON format:
{"key":"value","key2":"value2"}
c776ee49-f608-4a77-8cc8-6fe96ae1e43f)To link records to other objects (e.g., People to Companies), add a column with the unique identifier of the related record.
Example: Linking People to Companies
Add a column to your People CSV:
firstName,lastName,email,companyDomain
John,Smith,[email protected],https://acme.com
Jane,Doe,[email protected],https://widgets.co
Important rules for relations:
https://domain.com), not the labelcompanyId AND companyDomain)Import the "one" side before the "many" side:
The parent record must exist before you can reference it. </Warning>
See How to Import Relations for detailed instructions.
The import creates records, not fields. All fields you want to import must already exist in your data model.
Before importing:
Before uploading your file, verify:
<Check>File is CSV, XLSX, or XLS format</Check>
<Check>File has fewer than 10,000 records</Check>
<Check>Encoding is UTF-8</Check>
<Check>No duplicate emails (for People) or domains (for Companies)</Check>
<Check>Dates use consistent format throughout</Check>
<Check>Domains use https://domain.com format</Check>
<Check>Boolean fields use TRUE or FALSE (uppercase)</Check>
<Check>Select fields use API names, not display labels</Check>
<Check>All custom fields exist in Settings → Data Model</Check>
<Check>Parent records imported before child records</Check>
<Check>Relation columns reference existing records</Check>
| Mistake | Solution |
|---|---|
Using true instead of TRUE | Boolean values must be uppercase |
| Using display labels for Select fields | Find and use API names in Settings |
| Importing People before Companies | Always import parent objects first |
| Missing currency code for Currency fields | Fill both Amount and Currency columns |
| Wrong domain format | Use https://domain.com consistently |
| Mapping multiple unique fields for relations | Map only ONE (domain OR id, not both) |
Your file is ready! Now: