Dynamic Binding on Server Side Validation

It would be extremely helpful if we could bind data to the server side validator. Dynamically making an input client side is very easy, but for more security I always set it on the server side too. I have built a form builder where I can set an input to required or not and would love to be able to repeat through the inputs when that form is submitted and if the input is required, set the validator to required with that input's field name so it connects to the input on the client side and a dynamic required message. Otherwise I have to go in and add each input manually to connect it to the front end input. Hope this makes sense. Seems like a simple add, no? See screenshots of what I'm trying to do. Perhaps there already is a way to do this and I don't know? Right now, only the "expression" can have dynamic binding.

The repeat:

The validator would look something like this:

1 Like

Add a repeat to make an array of fields with their values from the form.

wappler-form-values

Add a join to match the values from the form to the respective fields in the table.
For Collection 1, bind to the query.
For Collection 2, bind to the repeat.
For Match Columns, enter field_name and field_name.

Then repeat on the join and not on the query.
In Validate Data step, for the Expression, enter {{field_value}}.
For Linked Field and Message, dynamic bindings have to be manually entered as you have it.

There you go!

Thanks for the reply, @Quy . The repeat part is not the issue. The issue is the fact that currently, as you started in your reply, the linked field and message cannot be dynamically binded. :pensive: