Checking if a schema preview is a draft in

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:
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

The Sanity Composable Content Cloud is the 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?

Categorized in