Resolved: Getting unexpected "incompatible with field type error" in migration

Resolved: I assumed plugin ids would be the same across environments, that’s not the case. Using the plugin id for that environment solved it.


Hi!

I’m trying to create a field through a migration and adding the Conditional Fields plugin to it. I’ve copied the properties of this field from another field so I’m certain this should work.

Details

Failed request:

POST https://site-api.datocms.com/item-types/450842/fields

content-type: application/json
accept: application/json
authorization: Bearer [redacted]
user-agent: js-client v3.2.0
X-Api-Version: 3
X-Environment: add-contact-footer-employee

{"data":{"type":"field","attributes":{"label":"Is external?","field_type":"boolean","api_key":"cta_external","localized":false,"validators":{},"appearance":{"addons":[{"id":"23963","parameters":{"invert":false,"slave_fields":"cta_url"}}],"editor":"boolean","parameters":{}},"position":5,"hint":null,"default_value":null},"relationships":{"fieldset":{"data":null}}}}

HTTP Response:

422 Unprocessable Entity


{"data":[{"id":"bf6938","type":"api_error","attributes":{"code":"INVALID_FIELD","details":{"field":"appearance.addons.0.id","code":"VALIDATION_INVALID","message":"incompatible with field type"}}}]}

Could you help out?

1 Like