It would be great to provide a snippet of javascript or similar that would evaluate input for a given field and return either an all-good or an error message.
We can implement this in two ways:
- User provides an endpoint, and DatoCMS calls such endpoint passing the payload to validate
- User provides some JS validation function, and DatoCMS runs it inside a sandbox environment https://www.npmjs.com/package/vm2
Hi Stefano! Was this feature implemented? Thanks.
hey @guido.lode not yet.
We tag the feature requests that we release as “launched”. The ones that are currently on our backlog (being in development or soon in dev) ar tagged as “planned”, so that you can track how things are going.
@mat_jack1 Any updates on where this might land on the roadmap? Very interested to get my team on DatoCMS, but without deeper validation abilities we’re a bit hamstrung.
hey @aaronransley sorry but we haven’t decided yet for this feature. It might come in the next 3 to 6 months though, as it’s not very complex, we are just planning to do other wider features before. We’ll publish soon a roadmap for the next three months in our blog!
Hey very long time ago for this feature but what’s the state now? Never?
Sorry @gdoumenc, this is still not a planned feature
However, you can now make a custom plugin as a field extension that does validation: https://www.datocms.com/docs/plugin-sdk/field-extensions
And you can intercept/prohibit record saving with a hook: