Get a peek at our latest innovations at Sanity Product Day on Dec 8th →

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.io: Get the most out of your content

Sanity.io is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Free to get started, and pay-as-you-go on all plans. Find out more.