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.io – build remarkable experiences at scale

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

Categorized in