Trigger Form Validation

The Trigger Form Validation Action is used in tandem with the Form Web Control, which automatically generates forms out of Data Models. When fired, the Trigger Form Validation Action compares the information entered by the user with the Validations associated with the Data Model and defines user-facing error messages accordingly. In this way, the Trigger Form Validation Action can be conceptualized as an extremely specialized offshoot of the Set Variable Action, where the only variables it sets are the variables that define error messages in Forms.

Most relevant Trigger Form Validation Actions will come pre-configured when Making Forms from Data Models, but if you want to generate error messages from Model-level Validation Rules, you will need to configure both the Validation Rules and the Trigger Form Validation Action manually.

Properties

Validation Rules to Run

Expects type List of text.

This text in this List must correspond to Validation Rules defined in the Form Web Control, under Properties > General > Validation Rules. The given Validation Rules use the RUN_VALIDATIONS function to refer directly to the Data Model associated with the Form, comparing user input to the analogous Model properties and generating appropriate error messages as relevant. These error messages are then automatically tied to an Activity Variable automatically generated by the Form Web Control, which, in turn, automatically defines appropriate property-level error messages, and can be configured to define appropriate Model-level error messages as well.

If given an empty List as input here, the Trigger Form Validation Action will run all the Validation Rules associated with the Form.

Example

In the case of managing Property-level Validation Rules, the Trigger Form Validation Action is configured automatically as part of create a Form Control: the On Blur Event associated with each input box fires a Trigger Form Validation Action that runs the Validation Rule associated with the relevant property.

For instance, consider the following Form Web Control. It has three properties and comes out-of-the-box with Validation Rules for each of them. Focus particularly on the one associated with the name property, "name_validation_rule":

The On Blur Event associated with the input box in the "Name" Container fires a Trigger Form Validation Action that runs that Validation Rule:

With this configured, if a user toggles away from this input box without entering a valid value, the associated error message will become visible below the input box:

Managing Model-level Validations requires more customizing. Form Controls do not come with them pre-configured because many digitized forms span multiple Web Pages, and Model-level Validations can only reasonably be preformed after all relevant information has been gathered. Managing Model-level Validation Rules must therefore be configured manually. For an example of how to do that, see Making Forms from Data Models.