Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejson
"validators": [
    {
      "type": "js_expression",
      "failsWhenExpression": "isEmpty(guardianRelationship) || age height <= 140",
      "message": "PatientHeight should isbe eithergreater pediatricthan or aequal student. Please provide guardian relationship information.to zero"
    }
]

In this example, the guardianRelationship height field will fail validation if it is empty and the age is 14 or youngerheight is lesser than zero. When the condition evaluates to true, the provided message will be displayed, indicating the validation error.

...

  • Expression: The logical condition that must be met for the validation to fail.

  • Message: The error message displayed to the user when the validation fails.

The isEmpty function checks whether the field value is empty, and age <= 14 ensures the validation rule only applies to users who are 14 or younger.FailsWhenExpression.mov