Creating a New Validation

Creating a new Validation

Creating a new Validation consists of the following steps:

  1. To create a new Validation, you can:
    • Create a Validation from scratch by either:
      • Click on Add Validation at the bottom of the Validation Designer to add the validation to the end of the current list
      • Click on the "+" within an existing Validation, to slot in the Validation below the current Validation.
        Validation Designer - Validation collapsed
    • Duplicate an existing Validation:
      • The Validation must be in "Edit mode", which will reveal the "Duplicate" link.
        Validation Designer - Validation when opened for editing
  2. Select the Form Field which you need to validate.

    Menu path separator The System will display all fields in the current form, ordered by

    • Pages, in the order as defined in the Form Builder
    • and within each Page alphabetically.
  3. The fields selected for "Validate that" must NOT be read-only - otherwise the user will not be in a position to take corrective action on this field if the validation is triggered.
    If you need to include a read-only field in a validation, include it in the Condition (see below).
  4. Define which Condition the Field needs to meet, so that the record can be saved.

    Menu path separator The options displayed by the system will depend on the field type you selected in the previous step.

  5. Define the Validation Message.

    Menu path separator This is the message the system will display to the user if the validation fails.

What you are able to validate against will depend on the Field Type you have selected.
Following is a collection of the possible validations, based on the Field Types of the validated field.

Validations

Field Type: ALL

Available Operators

Available Values

  • is set Menu path separator i.e. has a value
  • is not set Menu path separator i.e. does not have a value

N/A.

Note

THIS CANNOT BE USED FOR SINGLE-SELECT CHECK-BOX:

  • A single select check-box can only be used for Questions.
  • A check-box will always evaluate as IS SET, because it either has a value or YES or NO.

 

Field Types: Component Lookup (single selection), Date, Lookup (single selection), Number, Text, Time

Available Operators

Available Values

  • is unique (with ...)

The "is unique with ..." operator can be used to check for uniqueness of

  • a single field (e.g. the "User ID")
  • multiple fields (e.g. the combination of "Last Name" + "First Name" + "Date of Birth").
  • a value within the Context of a Parent Record (e.g. for any given Action Record, no two Action Progress Records can have the same value for "Percentage Complete).

This can be controlled by the use of the values on the Right Hand Side of the Operator.

  • Uniqueness of a SINGLE field within a Component:
    Select the required field on the Left Hand Side, but leave the Right Hand Side empty. Your validation could read:

    Validate that "User ID" is unique with ...
  • Uniqueness of MULTIPLE Fields within a Component:
    If, in addition to the Left Hand Side, you add more fields to the Right Hand Side, then the system will ensure that the combination of all these fields is unique.
    If the Uniqueness is violated, then the System will display a Validation Error on the field which is listed on the Left Hand Side. For example:

    Validate that "Last Name" is unique with ... "First Name", "Date of Birth"
  • is unique within Parent

This operator can be used to check for the Uniqueness of a single within the CONTEXT of a Parent Record:

  • The difference here is that the system will allow multiple "identical" values within a Component (e.g. Action Progress Records can have multiple records with identical values for "Percentage Complete").

    But you can ensure that for a given Parent record, values in it's related Subform records are unique (e.g. a given Action cannot have two Action Progress Records with identical values for "Percentage Complete").

Note

LIMITATIONS

The UNIQUE WITH PARENT validation can only be performed against already SAVED records.

Therefore, if you were to create/edit multiple Subform Records before performing a SAVE, the validation would not work correctly.

 

In addition to the above, other field types offer the following options

Field Type: Date

Available Operators

Available Values

  • [=] is equal to
  • [?] is not equal to
  • [<] is before
  • [<=] is on or before
  • [>] is after
  • [>=] is on or after

To compare the validated field against:

  • another date field on the form, select from the list of other date fields which are available on the form.
  • the current date, select TODAY

You can also add or deduct a number of days from the selected value. Click on the arrow "Menu path separator" next to the field, which then will open a control where you can set the required value.

For example:

  • Date Raised is less than or equal Today
  • Action Due Date is after Date Raised
  • Action Due Date is less than Today + 60 days

Field Type: Time

Available Operators

Available Values

  • [=] is equal to
  • [?] is not equal to
  • [<] is before
  • [<=] is on or before
  • [>] is after
  • [>=] is on or after

To compare the validated field against:

  • the current system time, select NOW
  • another time field on the form, select from the list of other time fields which are available on the form.

    For example:
    Time Incident Reported is before NOW

Field Type: Lookup (single selection)

Available Operators

Available Values

  • [=] is equal to
  • [?] is not equal to

You can compare against any of the available values of the validated lookup.

To compare

  • select the value from the list of values.

    For example:
    Action Priority is equal to Urgent

Field Type: Lookup (multiple selection)

Available Operators

Available Values

  • has value
  • does not have value
  • has ONLY value
  • is single select if value is

You can compare against any of the available values of the validated lookup.

To achieve that

  • a certain value needs to be included, select has value
  • a certain value must not be included, select does not have value
  • that only this particular value can be selected, and no other value, select has ONLY value.
  • a user can select any combination of values, EXCEPT when this particular value is included. Once this particular value has been selected, the system will behave like a single lookup, and no other values can be selected.

    For example:
    Incident Consequences is single select if value is Near Miss

Field Type: Number (Integer or Decimal)

Available Operators

Available Values

  • [=] is equal to
  • [?] is not equal to
  • [<] is less than
  • [>] is greater than
  • [<=] is less than or equal to
  • [>=] is greater than or equal to

To compare the validated field against:

  • a fixed value, select a Constant from the list.
    Note that only if a constant has been defined, will you be able to select one from the list.
  • another number field on the form, select from the list of other number fields which are available on the form.

    For example:
    Max Measurement is greater than Min Measurement.

Field Type: Component Lookup (single selection)

Available Operators

Available Values

  • [=] is equal to
  • [?] is not equal to

You can compare two Component Lookups against each other, as long as they are based on the same Component.

For example:
Person [Assigned To] is not equal to [Assigned by].

Field Type: Subforms

Available Operators

Available Values

  • has records
  • has no records
  • [=] record count is equal to
  • [?] record count is not equal to
  • [<] record count is less than
  • [>] record count is greater than
  • [<=] record count is less than or equal to
  • [>=] record count is greater than or equal to

To compare the validated field against:

  • a fixed value, select a Constant from the list.
    Note that only if a constant has been defined, will you be able to select one from the list.
  • another number field on the form, select from the list of other number fields which are available on the form.

    For example:
    Max Measurement is greater than Min Measurement.

 

Field Type: Questionnaires

Available Operators

Available Values

  • questions all answered

To ensure that, when answering a Questionnaire, a user has either answered, or mark as N/A all of the Questions in the Questionnaire.

Please note:
this validation cannot be used for Checkbox fields (Yes/No, True/False) fields, Text and Date fields.

Instead of a Checkbox field you can use Lookup fields instead, if this type of validation is required.

How can I "drill down" to validate a Field?

In some instances, to create a validation it may be necessary to refer to a value which is not on the current form, but is stored in one of the related records.

For example:

  • For a Validation:
    Validate that the "Unit of Measure FROM/Type" is equal to the "Unit of Measure TO/Type"
  • For the When condition
    Validate that the field 'Has the Contractor been notified' has been ticked
    WHEN the "Injured Person/Employment Status" is equal to 'External'.

While you will have the fields "Unit of Measure FROM", or "Injured Person" on the form, the information required to define the validation is contained in the related record - this is the reason you need to "drill down" into a field.

Question

Answer

How can I identify if it is possible to drill down on a field?

If you select a field/relationship which offers drill down, the system will display a Menu path separator symbol next to the field name.

How do I drill down?

Simply by clicking on the Menu path separator symbol.

The system will display lookups and 'next-level' relationships of the selected relationship, from which you can select the required field.

To define the condition, proceed as described above.

Why can't I drill down to all relationships?

Due to technical limitations, it is not possible to drill down to 'To-Many' relationships.

See Also

Validations

How to define Validations

How to validate a Field only WHEN a Condition is met?

Perform a Validation across several Pages

Filtering and Finding Validations in the Validation Designer

Sample Validations