✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

How to preview the first element in an array of references?

2 replies
Last updated: Nov 1, 2020
Hi everyone! I know that I can preview references like this:
preview: {
  select: {
    title: 'title',
    subtitle: 'referenceField.referencedTitle'
 }
}
But now I have an array of references and I would like to preview the first element in the array. This doesn't work for me:


preview: {
  select: {
    title: 'title',
    subtitle: 'referenceArrayField[0].referencedTitle'
 }
}
Is this technically possible? Thanks for any pointers
😃
Nov 1, 2020, 7:56 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?