
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes! It's definitely possible to display a list of schemas/content types and restrict selection to just one. This is exactly what the reference field type is designed for in Sanity Studio.
When you set up a reference field, you specify which document types can be referenced using the to property. Here's a basic example:
{
name: 'myReference',
type: 'reference',
to: [
{type: 'person'},
{type: 'company'},
{type: 'organization'}
]
}This will show the user a list of all three document types (person, company, organization) to choose from, but they can only select one document from those types.
filter option if you need more controlIf you actually want users to select multiple documents, you'd wrap the reference in an array:
{
name: 'myReferences',
type: 'array',
of: [
{
type: 'reference',
to: [{type: 'person'}, {type: 'company'}]
}
]
}But based on your question about selecting "only one," the standard reference field should be exactly what you need!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store