Replace a PortableText object with another #4249
Unanswered
theocampbell
asked this question in
Sanity Studio Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I have created a portable text component with a feature that allows the user to add a tooltip with some extra information to explain an idea or a work within the text. To do this I have the schema for the tooltip:
and it renders on the front end like this:
We have around 80 documents that can have this tooltip used within it. I would like to replace them all with a different schema that has a very similar structure.
I am not sure the best way to go about this? I could just remove the original schema and go through each document and change them but this seems quit time consuming. Is there perhaps a way to write a groq query to find all documents that are using this feature? Or is there a way to simply replace the original with the new?
Alternatively I could perhaps mutate the original schema using something like this.
Has anyone come across this problem?
Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions