
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on your description, it sounds like you have a string field with a dropdown (list) layout defined in your schema, but when you import data via script, the values aren't showing up in the Studio UI even though they appear in the document data.
The most common cause of this issue is a mismatch between the value you're writing and the values defined in your schema's options.list array.
In Sanity, when you define a dropdown field, you typically use something like:
{
name: 'myDropdownField',
type: 'string',
options: {
list: [
{title: 'Option One', value: 'option-one'},
{title: 'Option Two', value: 'option-two'}
],
layout: 'dropdown'
}
}The key issue: Your script must write the exact value (not the title) that's defined in the schema. If your data contains 'Option One' but your schema expects 'option-one', the Studio won't recognize it and the dropdown will appear blank.
Here's how to troubleshoot:
options.list array for those fields and note the exact value propertiesvalue properties in your schema's list (case-sensitive)For example, if your schema has:
options: {
list: ['draft', 'published', 'archived']
}Your script must write exactly 'draft', 'published', or 'archived' - not 'Draft' or any variation.
Additional tip: If you're migrating from another system, you might need to create a mapping function in your script to transform your source values into the values expected by your Sanity schema. Something like:
const statusMap = {
'Draft': 'draft',
'Published': 'published',
'Archived': 'archived'
}
const sanitizedData = {
...yourData,
status: statusMap[yourData.status] || 'draft'
}If you share your schema definition for one of those dropdown fields and an example of the data you're writing, I can help pinpoint the exact mismatch!
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