Joint session with Vercel: How to build intelligent storefronts (May 15th) →

How to display multiple schemas but allow selecting only one?

16 repliesLast updated: Nov 29, 2025

Hey šŸ‘‹ Just a quick question, is it possible to display a list of schemas/content types but only allow the user to select one?
AI Update

Yes! 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.

How it works

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.

Key points

If you need multiple selections

If 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!

Show original thread
16 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

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.

Related contributions