πŸ‘€ Our most exciting product launch yet πŸš€ Join us May 8th for Sanity Connect

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?