šŸ‘‹ Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Boolean initialValue Not Holding State

6 replies
Last updated: Jun 17, 2021
Hi! šŸ™‚ I have a question about Boolean types.So I've created a
boolean
initialValue
to true but when I try to run locally sanity studio the toggle is in the middle šŸ¤”
Am I missing something out? Sorry but I'm new to the platform
šŸ™‚
Jun 17, 2021, 4:45 PM
I've added in the
fields
array a new boolean type and run the studio
Jun 17, 2021, 4:50 PM
its for an existing one šŸ™‚
Jun 17, 2021, 4:50 PM
Initial values will only work for new documents, so anything already created would need to be set manually. However, any new documents should respect your
initialValue
setting.
Jun 17, 2021, 4:51 PM
If you have hundreds or more documents to set, you could also set them programmatically.
Jun 17, 2021, 4:52 PM
Sweet, I get it!! Thanks for the help
user A
appreciate it šŸ™‚
Jun 17, 2021, 4:53 PM
Great! šŸ™Œ
Jun 17, 2021, 4:54 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?