packages/twenty-docs/user-guide/data-migration/how-tos/import-relations-between-objects-via-csv.mdx
This guide walks you through importing relations between objects—for example, linking People to Companies, or Opportunities to People.
<Note>What can be imported: Only one-to-many relations pointing to a single object type. Relations pointing to multiple object types (like Notes linking to People AND Companies) are not yet supported for import.</Note>
In a one-to-many relation:
The "one" side is the parent. The "many" side is the child.
| Relation | "One" Side (Parent) | "Many" Side (Child) |
|---|---|---|
| Companies → People | Company | People |
| Companies → Opportunities | Company | Opportunities |
| People → Tasks | Person | Tasks |
| People → Notes | Person | Notes |
Before importing, determine which object is the parent and which is the child.
Ask yourself: "Does ONE [Object A] have MANY [Object B]?"
The parent ("one" side) must exist in Twenty before you can reference it.
Import order:
Always verify that Companies are imported before importing People with company references. </Warning>
You need to reference the parent record using a unique identifier. Available options:
| Parent Object | Available Unique Identifiers |
|---|---|
| Companies | id (UUID), domain (recommended), or any custom unique field |
| People | id (UUID), email, or any custom unique field |
| Workspace Members | id (UUID), email (not name) |
| Custom Objects | id (UUID), or any field marked as unique |
<Note>Recommended: Use domain for Companies and email for People. These are human-readable and easy to verify in your spreadsheet.</Note>
If you need the id:
id columnBefore importing, ensure the relation field exists between your objects.
To check or create:
Add a column to your child CSV that references the parent using its unique identifier.
Your People CSV:
firstName,lastName,email,jobTitle,companyDomain
John,Smith,[email protected],CEO,https://acme.com
Jane,Doe,[email protected],CTO,https://widgets.co
Bob,Johnson,[email protected],Developer,https://techstart.io
The companyDomain column references the Company's domain.
| Identifier | Format | Example |
|---|---|---|
| Domain | URL format | https://acme.com |
| Standard email | [email protected] | |
| ID | UUID | c776ee49-f608-4a77-8cc8-6fe96ae1e43f |
Use https://domain.com (not just domain.com). This matches how Twenty stores Company domains and prevents matching errors.
</Warning>
companyId AND companyDomainAcme.com ≠ acme.comcompanyDomain)Twenty will automatically link each child record to the matching parent.
After importing:
| Mistake | Problem | Solution |
|---|---|---|
| Wrong import order | Importing People before Companies | Always import parents first, then children |
| Wrong domain format | Using acme.com instead of https://acme.com | Use full URL format with https:// |
| Multiple unique fields | Mapping both companyId AND companyDomain | Map only ONE unique identifier |
| Missing relation field | The relation field doesn't exist in the data model | Create it in Settings → Data Model before importing |
| Non-existent records | The parent record doesn't exist in Twenty | Import parent records first, or check for typos |
| Case mismatch | Acme.com in file but acme.com in Twenty | Ensure exact case matching |
When linking to Workspace Members (your team):
[email protected], not "John Smith"taskName,assignedTo
Follow up with client,[email protected]
Review proposal,[email protected]
If you're getting "not found" errors but the record seems to exist, check Command Menu → See deleted records. The parent may have been soft-deleted. </Warning>
Having issues? Check: