Skip to content

Commit

Permalink
Merge pull request #437 from gristlabs/Additions-to-two-way-references
Browse files Browse the repository at this point in the history
Updates to two-way references
  • Loading branch information
nbush authored Nov 4, 2024
2 parents e8afec7 + 06666f8 commit 29a983d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion help/en/docs/col-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ the underlying table and insert the proper reference:
*![Add reference value](images/column-ref-add-value.png)*
{: .screenshot-half }

## Creating a two-way Reference
## Two-way References

By default, new reference columns are added to a table as one-way references. This means they exist only as a single column within that specific table. Grist also allows you to configure a reference column with two-way references. This creates a new column in the referenced (or target) table, meaning that references between the two will be shown in both tables and remain synchronized.

Expand All @@ -91,6 +91,25 @@ This creates a new reference column in the referenced table, *Clients*. Since th

*![two-way-ref-2](images/columns/two-way-ref-2.png)*

Two-way references will respect if a column is a Reference or Reference List. For example, the **Client** column in the *Projects* table is a Reference column, meaning only one **Client** can be assigned to each project.

The **Project** "Newsletter template" is already assigned to the **Client** "Prime Builders International". What happens if we try to assign this project to "ABC Construction Company"?

*![two-way-error-1](images/columns/two-way-error-1.png)*

A pop-up will appear that tells us the record is already assigned. If needed, you can reassign the record to the new **Client** by checking the box.

*![two-way-error-2](images/columns/two-way-error-2.png)*
{: .screenshot-half }

To delete a two-way reference, select the reference column you wish to keep. Then in the Creator Panel, click the trash icon next to 'Two-Way Reference'. This will delete the reference column in the target table. For example, when the **Client** column in the *Projects* table is selected, clicking the trash icon will delete the **Projects** column in the target table, *Clients*.

*![two-way-delete](images/columns/two-way-delete.png)*

Alternatively, you can delete a two-way reference by selecting the column then by either selecting 'Delete column' from the column menu or using the <code class="keys">*Alt* + *Minus*</code> keyboard shortcut.

Please note that two-way references cannot be used on [Formula](formulas.md) columns.

## Converting Text column to Reference

When working with existing data, it's common to have existing text values that should really be
Expand Down
Binary file added help/en/docs/images/columns/two-way-delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added help/en/docs/images/columns/two-way-error-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added help/en/docs/images/columns/two-way-error-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 29a983d

Please sign in to comment.