🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Updating a Block field type in Sanity and how to handle strings vs. arrays

5 replies
Last updated: Jun 14, 2023
Hello everyone.i would like to update a field type Block. At this moment no woks fine. Does anyone have any idea?
Jun 14, 2023, 10:31 PM
What sort of data are you trying to add to the field and what do you mean by it doesn’t work?
Jun 14, 2023, 11:02 PM
Hello! this
Jun 14, 2023, 11:07 PM
but, does't work
Jun 14, 2023, 11:07 PM
Got it. It’s not working because a portable text field can’t take a string. It’s actually an array of blocks under the hood. If you just have strings, you can transform them into portable text with this package.
Jun 14, 2023, 11:09 PM
oww, I'm going to check
Jun 14, 2023, 11:10 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?