Integration Fields with Slice Machine

Integration Fields with Slice Machine has been a highly requested feature request. The field isn't yet available in the Slice Machine Interface, but that doesn't mean you can't use it already.

Here's the temporary solution to add Integration fields to your documents:

  1. First, ensure Integration Fields are enabled in your repository. If you don't have it, reach out to us so that we can activate it for you. Then add your catalog.
  2. Open your project in your favorite code editor. Run Slice Machine
  3. Find the index.json of the Custom Type or the model.json of your Slice and add the integration Field:
"api_id": {
   "type": "IntegrationFields",
   "config": {
      "catalog": "my-repository--your_store",
       "label": "Here goes the field name",
      "placeholder": "This is the field placeholder..."
   }
}
  1. Add a new name for the api_id of the field and modify the catalog value to match repository settings. For example, if your repository is called lorem and your Integration catalog is called my store, the value will be: "catalog": "lorem--my_store".
  2. Save your JSON file, Push your changes to Prismic, and you're done. Now you can visualize and use your integration field in the documents!

I've been testing this, and it seems that the naming convention for the catalog uses an underscore, rather than a dash. So if your Integration catalog is called "my store", it would be "my_store"

1 Like

That's correct, @joe.w, thanks for pointing that out :100:

Minor thing we encountered is that this should all be lowercase :smiley:

So if our catalogue is called "My Awesome Store" and our prismic project is called "CoolProject" then the value should be `"catalogue": "coolproject--my_awesome_store"

1 Like