🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Duplicating content in Sanity Studio v3.40.0 causes reference issues

8 replies
Last updated: May 21, 2024
🧵 Curious if this is a known bug - using studio v
May 21, 2024, 11:18 PM
Duplicating content in an array using the default "Duplicate" option does some interesting things.
If you duplicate an object, then edit a field in one instance - all other fields get updated.
May 21, 2024, 11:21 PM
Kinda looks like the duplicated content receives the same id.
May 21, 2024, 11:21 PM
Heres a barebones query showing the id issue, which is what I think this stems from.
May 21, 2024, 11:23 PM
From your query it looks like cards are references, so you’re duplicating the card but it’s pointing at the same document.
May 21, 2024, 11:27 PM
Ahh gotcha
May 21, 2024, 11:27 PM
That makes total sense - I was hitting a wall here. 🤦Thanks
May 21, 2024, 11:28 PM
I think what you’ll need to do is:
1. Open the referenced document.
2. Duplicate it from the menu in the bottom-left.
3. [Make changes now or later]
4. Go back to the source document.
5. Change the reference to point at the new document.
May 21, 2024, 11:28 PM
All good!
May 21, 2024, 11:28 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?