e5ac9f5b8b
Follow-up based on comments from https://github.com/twentyhq/twenty/pull/23266 <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/23429?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Félix Malfait <felix@twenty.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
70 lines
2.1 KiB
Plaintext
70 lines
2.1 KiB
Plaintext
---
|
|
title: Create Relation Fields
|
|
description: Step-by-step guide to connecting objects with relation fields.
|
|
---
|
|
|
|
Relation fields connect records from different objects—for example, linking People to Companies.
|
|
|
|
<Note>
|
|
**Relation names cannot be changed after creation** (they affect the API). Plan your names carefully.
|
|
</Note>
|
|
|
|
## Before You Start
|
|
|
|
Decide:
|
|
- Which objects are you connecting? (e.g., People → Companies)
|
|
- Which is the "one" side? (e.g., Company)
|
|
- Which is the "many" side? (e.g., People — many people work at one company)
|
|
- What should the field be named on each side?
|
|
|
|
See [Relation Fields](/user-guide/data-model/capabilities/relation-fields) for relation types explained.
|
|
|
|
## Steps
|
|
|
|
1. Go to **Settings → Data Model**
|
|
2. Select the object where you want the relation (typically the "many" side)
|
|
3. Click **+ New Field**
|
|
4. Select **Relation** as the field type
|
|
5. Choose the **target object**
|
|
6. Select **One-to-Many** or **Many-to-One**
|
|
7. Enter field names for **both sides** of the relation
|
|
8. Click **Save**
|
|
|
|
## Example: People → Companies
|
|
|
|
- Go to **Settings → Data Model → People**
|
|
- Add a Relation field
|
|
- Target: **Companies**
|
|
- Type: **Many-to-One**
|
|
- Field on People: **Company**
|
|
- Field on Companies: **Employees**
|
|
|
|
Now each Person can be linked to a Company, and each Company shows its People.
|
|
|
|
## Deactivating a Relation
|
|
|
|
1. Go to **Settings → Data Model → object of your choice**
|
|
2. Find the relation field and click it
|
|
3. Click **Deactivate** button
|
|
|
|
Links are preserved but hidden. Reactivate to restore.
|
|
|
|
<Note>
|
|
**Deactivating a relation doesn't delete records.** Only the link between them is removed.
|
|
</Note>
|
|
|
|
## Deleting a Relation
|
|
|
|
1. Go to **Settings → Data Model → object of your choice**
|
|
2. Find the relation field and click it
|
|
3. Click **Delete** button
|
|
|
|
<Note>
|
|
Applies only to custom relations. Standard relations can only be deactivated.
|
|
</Note>
|
|
|
|
## Related
|
|
|
|
- [Relation Fields](/user-guide/data-model/capabilities/relation-fields) — types and limitations
|
|
- [How to Import Relations](/user-guide/data-migration/how-tos/import-relations-between-objects-via-csv) — bulk import linked records
|