How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Concatenate multiple fields for document title in Sanity Studio list view

5 repliesLast updated: Nov 29, 2025

Is there a way to modify (concatenate) the document title in the studio document list view?By default it picks the value from the first field in my schema. However, I would like the name in the list to be created from concatenating three of the fields.

schema

{ title:"License Plate", name:"licensePlate", type:"string"},
{ title:"Model", name:"model", type:"string"},
{title:"Manufacturer", name:"manufacturer", 
        type: "array", of: [
           {type:'reference',
              to: [ {type:"manufacturer"}]
            }
             ]}
studio list view
“LKJ546 - BMW X5”

Is there a way to achieve this?
AI Update

Yes, you can absolutely customize the document title in the Studio list view by using the preview configuration in your schema! This is done using the select and prepare functions.

Here's how you'd achieve your specific use case of concatenating the license plate, model, and manufacturer:

{
  name: 'vehicle', // or whatever your document type is called
  type: 'document',
  fields: [
    { title: "License Plate", name: "licensePlate", type: "string" },
    { title: "Model", name: "model", type: "string" },
    { 
      title: "Manufacturer", 
      name: "manufacturer",
      type: "array", 
      of: [
        {
          type: 'reference',
          to: [{type: "manufacturer"}]
        }
      ]
    }
  ],
  preview: {
    select: {
      licensePlate: 'licensePlate',
      model: 'model',
      // Use dot notation to dereference the first manufacturer reference
      manufacturerName: 'manufacturer.0.name'
    },
    prepare({licensePlate, model, manufacturerName}) {
      return {
        title: `${licensePlate} - ${manufacturerName} ${model}`
      }
    }
  }
}

The key points here:

If your manufacturer reference might not always be set, you can add a fallback:

prepare({licensePlate, model, manufacturerName}) {
  return {
    title: `${licensePlate || 'No Plate'} - ${manufacturerName || 'Unknown'} ${model || 'Unknown Model'}`
  }
}

You can learn more about preview configuration and dereferencing references in the official Sanity documentation on previews and list views.

Show original thread
5 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