Go Behind the Experience to see how Tecovas brings the West to life with Sanity 🤠 July 18th

Checking if a schema preview is a draft in Sanity.io

3 replies
Last updated: Apr 23, 2020
Is there any way in schema > preview to know if it is a draft or not?
Apr 23, 2020, 8:39 AM
You could check whether the
string starts with
. A bit further down this page there’s an example of using
to perform some logic with your selection of preview fields: https://www.sanity.io/docs/previews-list-views#specify-preview-options-857e5d82a2d3
Let me know if that’s enough to get going
Apr 23, 2020, 8:46 AM
Thanks, it worked!
Apr 23, 2020, 9:25 AM
Great, Jørgen! Thanks for confirming 🎉
Apr 23, 2020, 9:30 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?