Can Sanity string type list be a promise?

20 replies
Last updated: Nov 29, 2025
Can
string
type
list
be a promise?
AI Update

Based on the context of your question, I believe you're asking whether the list property on a string field (which defines dropdown/select options) can be a promise or async function.

No, the list property cannot be a promise. The list property in Sanity schema definitions must be either:

  1. An array of strings or objects:
defineField({
  name: 'category',
  type: 'string',
  options: {
    list: ['news', 'blog', 'tutorial']
    // or
    // list: [
    //   {title: 'News', value: 'news'},
    //   {title: 'Blog', value: 'blog'}
    // ]
  }
})
  1. A synchronous function that returns an array:
defineField({
  name: 'category',
  type: 'string',
  options: {
    list: () => ['news', 'blog', 'tutorial']
  }
})

The schema definition in Sanity is evaluated synchronously when Studio loads, so promises and async functions aren't supported in the list property.

Workarounds for dynamic options:

If you need to load options dynamically from an API or database, you have a few alternatives:

  1. Create a separate document type for your options and use a reference field instead of a string list
  2. Use a custom input component that fetches options asynchronously and renders them as a dropdown
  3. Pre-populate options during your build/deploy process and include them in your schema definition

The custom input component approach gives you the most flexibility - you can fetch data when the component mounts and present it to users while still storing the value as a string field.

Show original thread
20 replies

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.

Was this answer helpful?