Server side validation Expression (Is it a bug?)

Hi,
Could someone help me to check if this works? Or if its a bug?

When I create a server side Validation and put in a POST variable as Expression it works.

But when I put in an expression like {{$_POST.upd_userName != getOldUserName.userName}} its not working.

The thing I am trying to do is to only “activate” the validator if new password received from POST
variable is different from old one fetched from DB.

Should it be possible to put in Expression in this field?
If so, could somebody please try and see if it works?

Thank you.

Hello again,
No one knows if it should be and is possible to use expressions in server side validation?
Tnx!

I would assume it’s not possible.

I believe the expression field is used to identify the content and its format but the validation rules are predefined in the validation properties panel.

It seems that you are actually trying to build a validation rule in the expression.

Have you tried the “Not Equal” rule for that?

Why not wrap the validation step in a condition?
With the condition use your expression: {{$_POST.upd_userName != getOldUserName.userName}}

in the then part add the validation step with the POST being validated
in the else part add nothing

2 Likes

Hi,
@Teodor that was exactly what i had to do. I just figured since it states “Expression” it
would be possible to use an expression to “activate” the validation rule.
Thank you, now i know that its not used like that.