Run Validations
The Run Validation construct is used to verify whether the whole form or specific form validation group(s) is valid or invalid. Run Validation simply evaluates the current form state and returns a Boolean result (true for valid, false for invalid).
Key Benefits
- Validation Status Check: Determines whether the form or individual form groups are currently valid or invalid.
- Prevents Invalid Submission: Allows you to conditionally prevent form submission if validation fails.
- Efficient Error Handling: Enables custom logic execution based on the validation result.
Use Case Examples
- Pre-Submission Check: Ensuring the form is valid before triggering an API call or saving data.
- Conditional Navigation: Allowing navigation to the next step in a wizard only if the current step is valid.
- Custom Error Messages: Displaying custom error messages or performing additional checks based on the form's validity status.
Follow the below steps to add the Run Validation construct in an event flow:
In the designer canvas of an Interface, Master Layout and Component event flow, drag and drop the Run validation construct into the flow.
Double-click the construct to configure the properties as required and then click Save.
| Name | Description | Additional Comments |
|---|---|---|
| Label | Labels help developers quickly understand each step in the logic flow without examining the details of the construct. | It is recommended to provide a simple precise label that can improve the readability. |
| Form Selection * | Run validation on the entire form or specific individual groups by selecting the desired scope: Whole Form Individual Groups | If the whole form is selected, the validation check will be applied to the entire form, determining whether it is valid or invalid. If the Individual Groups are selected, a multi-select dropdown will appear (individual Groups), allowing you to choose and check specific form group(s) are valid or not. |
| Validation Groups* | Individual form groups are selected to check the form validity. | When individual groups are selected, only the form groups corresponding to the selected validation groups will be checked for the validation errors. |
| Comment | Comment this construct or not. Either Yes or No. | If marked as Yes, the construct is treated as a commented expression and ignored in code generation. |
| Description | Provides details about the Run validation purpose and behaviour. | Helps in understanding Run validation construct. |
Note: An asterisk (*) denotes that the property is mandatory for adding the Run validation.
Configure the edge paths for handling the valid and invalid scenarios. Allowed paths are valid, invalid, after.
Edge Paths
Double-click on the edge path to configure the properties required and then click Save.
Edge related description
- Valid: Returns true if the Run Validation operation detects no validation errors, indicating that the form or selected validation groups are valid. In this edge we can configure the logic when the form is valid.
- invalid: Returns false if the Run Validation operation detects validation errors, indicating that the form or selected validation groups are invalid. In this edge we can configure the logic when the form is invalid.
- after: Used to specify the logic run after the Run validation logic block.
The success message displays upon successfully adding the construct.