Register now - Learn how Tecovas roped in success with Sanity and Shopify 🀠

Adding a field to select multiple strings from a fixed list in 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:
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?

Categorized in