Updating all instances of a Slice programatically

Hi Folks, I am a front end dev at befunky.com We use Prismic as the CMS for our site, and I had a question about possibly updating a slice programatically.

We have a Call to Action slice that you can see at the bottom of our homepage above the footer. There is some text, a turquoise background, and a Get Started button. The JSON for that part of the slice looks like this. It allows the user to select the background color of the CTA on a per page basis.

"background" : {
            "type" : "Select",
            "config" : {
              "options" : [ "white", "offwhite", "turquoise", "salmon", "yellow", "lavender", "green", "none" ],
              "default_value" : "white",
              "label" : "Background"
            }
          }

Is there a way to programmatically replace the green with turquoise, in all places this slice is used via an API request or something? We have made some design changes on our site, and green is no longer used. Or is the best way to download all the Prismic content as JSON and do a find and replace?

thanks,

Anton

Hi @anton1 ,

Welcome to the Prismic community forum, and thanks for posting this question :slight_smile:

To do this in bulk, you can use Import/Export:

That page should explain everything you need. But, if not, let me know.

Best,
Sam

">

Thanks! That makes sense

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.