Is it possible to dynamically populate the values in a List for a string type?

3 replies
Last updated: Jul 7, 2020
is it possible to dynamically populate the values in a list for a
string
type?
Jul 6, 2020, 3:08 PM
just following up on this. Is it possible to populate the values of a list at runtime or can it only be done at build time?
Jul 7, 2020, 2:33 PM
actually, I guess one way around it is if I build a custom component that fetches those values at runtime. That would make more sense.
Jul 7, 2020, 2:50 PM
The built in component can't only do it at build time, but as you say, for dynamic values, a custom component is the way to go. Some resources that might be helpful:

https://github.com/sanity-io/sanity-recipes
https://github.com/sanity-io/sanity/tree/next/packages/example-studio/components
Jul 7, 2020, 3:11 PM

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?