Dynamic, Scalable Column Validation Rules in KNIME (Handling Multiple Errors per Row)

I have a table where I need to detect errors across multiple columns. My goal is to end up with a column that indicates the error, the column number/name, and the reason for the error.

I’m currently trying to do this using the Column Expressions node, but the code is becoming too long and will probably be difficult for someone else to maintain later. The examples below are only to explain the idea; they are not real cases.

Example:

If column B is different from

"Spanish"

, then it should return an error like:

Error - B - Different from "Spanish"

I also have conditions that evaluate multiple columns.

For example, if column C is

"Complaint"

, then column D must be

"Negative"

and column E must be

"Dissatisfied"

.

Expected result:

Error - C/D/E - When C is "Complaint", D must be "Negative" and E must be "Dissatisfied"

The issue is that a single row can have more than one error. So, for row 1, the final result could be something like:

Error - B - Different from "Spanish"
Error - C/D/E - When C is "Complaint", D must be "Negative" and E must be "Dissatisfied"

Is there a way to implement these validation rules dynamically? For example, by reading them from an external table instead of hardcoding everything inside Column Expressions?

I’m attaching the Column Expressions code I’m currently using as a reference.

code Column Expresions.txt