FIRST_VALIDATION
The function FIRST_VALIDATION takes an Object in which every property contains a List of strings, and returns the first string in the List contained by the specified property.
This function is intended to be used in tandem with the Form Web Control. It takes the Object defined by the Trigger Form Validation Action and uses it to define the dynamic error messages in the Form. Error messages cluster by Model property, and FIRST_VALIDATION is used to pull error messages to display accordingly.
Declaration
Parameters
form_object (required, type: Object)
An Object in which every property contains a List of strings.
An Object with this structure is automatically generated upon the creation of a Form Web Control. It is configured such that its value is dynamically updated by the Trigger Form Validation Action.
property_name (required, type: string)
A string that corresponds to a property in the given Object.
Return Values
error_message (type: string) The first string listed in the List associated with the designated property_name in the form_object.
Examples
Assume all of our examples have access to the following variable, example_form
. Note that example_form
is Object in which every property contains a List of strings:
The following example returns the first string in the List stored under the "name_validation_rule"
property in Object example_form
. Note that while there are multiple strings stored in this List, only the first one is returned:
The following example returns the first and only string in the List stored under the "phone_validation_rule"
property in Object example_form
:
The following example returns an empty string, because there are no strings contained in the in the List stored under the "email_validation_rule"
property in Object example_form
:
An empty string will also be returned by the FIRST_VALIDATION function if the value given for the property_name does not correspond with a property in the given Object:
Last updated