Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Is it possible to create a shared field for all documents of the same type in Sanity.io?

2 replies
Last updated: Mar 27, 2024
Hey everyone!
Does anyone know if it is possible to create a shared field for all documents of the same type. The idea would be that the user can input a custom value to field X for example in the first document and that value would then be shared by ALL documents of the same type.
Mar 26, 2024, 5:13 PM
šŸ‘‹ Iā€™d put that field in a document of its own. You could then either put it in a reference field in the documents that need to use it for easy editor access, or since you know that all documents are going to reference it you can leave it out entirely and just handle stitching it together with GROQ later.
Mar 26, 2024, 5:24 PM
Yeah or in a settings document. You could also create an action that updates the other documents on publish. So you update the field in one doc, click publish, and it patches the other docs.
Mar 27, 2024, 12:12 AM

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?