Decide what makes two records the same before merging rows. Preserve linked activity, review duplicates in a working copy, and test both create and edit behavior before relying on an access rule.
Start by deciding what makes two rows the same record. Then count matches using a helper formula, review the flagged rows, and test a rule that blocks new duplicates. The cleanup step matters if another table points to those records. Deleting one copy before reassigning its follow-ups can leave you with an incomplete customer history. Grist’s duplicate detection example
Choose a key that reflects the real-world record
If your company issues one customer number per account, that number is a good starting point. If you combine multiple systems and each can issue the same number, match on both the source system and the customer number. Use email as a key only if your team’s data policy says one email belongs to one record in that table. A shared billing inbox can legitimately appear on multiple contacts.
| Situation | Decision |
|---|---|
| Two contacts named Jamie Lee at different companies | Keep both and use distinct source contact keys. |
| Two rows from the same source with customer number C-104 | Review them as a duplicate candidate and compare linked records. |
| Customer number C-104 from two different source systems | Compare the source plus the number before deciding. |
| Several rows with no customer number | Send them to a missing-key review queue. A blank value supplies no identity. |
Flag matches while you can still see both copies
In a working copy, add a formula column called Match count. For a table whose ID is Contacts and whose text key column ID is Contact_Key, use this adapted example:
len(Contacts.lookupRecords(Contact_Key=$Contact_Key)) if $Contact_Key else 0
Grist looks up rows with the same key and counts them. A populated unique key counts as one because the current row is included. Two matches flag both records. Blank keys return zero in this example and need their own check. Use your document’s actual table and column IDs when adapting the formula. Grist formula cheat sheet
If keys arrived with inconsistent spacing or letter case, decide what your source treats as equivalent before normalizing. For example, trimming surrounding spaces may be appropriate for your imported text keys. Changing case may collapse identifiers that a source treats as distinct. Preserve the original values and review the proposed normalized keys in a new column before matching against them.
The count tells you how many matching rows exist. For a separate true/false flag in a filtered review view, use this adapted formula: len(Contacts.lookupRecords(Contact_Key=$Contact_Key)) > 1 if $Contact_Key else False. It marks each row in a repeated, nonblank key group as a duplicate candidate and leaves blank keys for the separate missing-key queue.
Resolve the duplicate before archiving either record
Suppose P-017 appears twice in your fictional CRM. One row holds an updated phone number. The other owns two open follow-ups. Choose the surviving row, document which values you will keep, and inspect every table that references either record. Move the dependent follow-ups to the surviving contact and confirm they appear in the contact’s history.
Use a small ledger to track what you did:
| Candidate | Surviving record | Dependent records to check | Verification |
|---|---|---|---|
| Two rows share P-017 | Existing contact used by the team | Follow-ups and past interactions | Both open actions appear under the surviving contact |
| Same name, different keys | Both rows remain | Check each contact’s company | No cross-company links |
| Missing key | Pending review | Check import source | Assign identity before merging |
Archive or delete the extra row only after checking the dependencies. Keep the ledger and a backup so a teammate can understand the decision later. If a recurring import created the problem, fix the match key at import time as well. Grist reference columns · OwnStack Atlas Grist import guide
Test a rule on both new records and edits
Grist documents a pattern that denies a proposed create or update when the resulting record’s match count exceeds one. The rule reads the proposed record through newRec. Adapt the vendor example to your helper column and add a memo that tells the editor what to do, such as “A contact with this key already exists. Find it before adding another row.” Grist’s duplicate access rule example
Try it in a copy using synthetic data and the same roles and entry routes people will use. Record the expected result and what you observe.
| Attempt | Expected outcome under the proposed policy |
|---|---|
| Create a row with a new key | Allowed |
| Create a second row with an existing key | Blocked with a helpful message |
| Edit a unique row’s key to match another row | Blocked |
| Edit a non-key field on a unique row | Allowed |
| Create a row with a blank key | Handled by your separate missing-key policy |
| Repeat the check through an import or integration used by the team | Actual behavior recorded before relying on the rule |
Review the order of your rules and resolve existing conflicts before enabling a strict policy on the working document. Otherwise an editor may hit a duplicate denial while trying to fix an unrelated field on an already duplicated row. Grist access rules
For the sample company-contact-follow-up model, see the Grist CRM companion draft.
What this guide establishes.
Product statements are linked to official documentation in context. The examples and acceptance checks are editorial guidance using fictional data. OwnStack Atlas has not run these workflows in a live product installation.
Documentation and product behavior can change. Check the linked source for your exact release, edition and client before changing a live workspace.