We would to have abbility to conditionally other field trigger validation is it possbile?

We would to have abbility to conditionally other field trigger validation for example

We have News collection with translations collection relationship.

If language code is english we want title/description etc would be required (not null/empty).

We now see conditional fields, but no ability to add validation via them only some visibility changes.

Is there any other workaround for this? or we neeed to extend via programming this?

Hey there! :waving_hand:

Welcome to the community. Super excited to have you here, and this is a great question.

There’s basically two parts to your question:

1. Validation Within Relationships

We don’t currently have support for validating data within a relationship. So you can’t set validation rules on a news collection that get applied to a related translations collection.

You’d have to set those validation rules directly on the individual translations collection instead.

2. Conditional Validation

We don’t have the ability to do conditional validation or change validation rules dynamically based on certain field changes.


If this is something you’d like to see, I’d encourage you to create feature requests for these on our GitHub repository if you haven’t already.


With all that in mind, it’s probably best to use a custom extension, specifically a hook, to add your logic for this.

And the good news is it’s relatively easy to do. Just check out our guides in the documentation on how to create custom hooks.

→ Hook Extensions Guide

You’ll want to use either the items.create or items.update event hooks to run your validation logic before the item gets saved to the database.