🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Finding Sections to Add to a Document Using the Reference Type Schema

2 replies
Last updated: Apr 30, 2021
Hey everyone! I need some help here. My client is having a really hard time finding sections to add to a document using the reference type schema. One of the biggest improvements she would like to have is for the results to at least be alphabetized. I know there is an "option.filter" available for the reference schema but can't find any examples of how to use it. Thanks in advance for any help!
Apr 29, 2021, 7:28 PM
will let you constrain your search, but just the filter (no projections,
, etc.). I tried pulling in the documents using
inside the filter function and sorting them, which works, but then applying them through
had no effect on the order of documents in the dropdown. I think you might need to go with a custom input component to get an alphabetized reference dropdown.
Apr 29, 2021, 9:14 PM
Apr 30, 2021, 3:31 PM

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?