Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Adding a field to select multiple strings from a fixed list in Sanity.io schema.

2 replies
Last updated: Oct 4, 2023
Hey šŸ‘‹
I'm trying to add a field to my schema so that I can select multiple strings from a list in the UI, for example, the user can select "A", "C", "E" from a list of strings ("A", "B", "C", D", "E"... etc)

Is there a best way to do this. The list to choose from will be fixed and won't need to be coded.

I was looking a array of type string, but I can't find a way to do it
Oct 4, 2023, 11:44 AM
If I understand your meaning, the following might be helpful: https://www.sanity.io/docs/array-type#list-dd1300e422eb
Basically you can change the options object in the scheme for the array to render as a list of checkboxes.
Oct 4, 2023, 12:26 PM
Ah that works. Perfect šŸ‘Œ
Oct 4, 2023, 12:42 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?