Validation

How Validation Works in PhixFlow

Validation can be configured to check data as it is being entered and before completing an Actionflow. This could be from simply checking if a field has been completed, to checking for duplicate records.

Validation is checked for the following events:

  • When a user submits their data via a form e.g. saves the data (Default)
  • On Blur, which means once a user leaves a field
  • When an existing record is loaded

Applying Validation

We recommend validation is applied at the table level to attributes as it is then automatically applied everywhere the attribute is used, see Adding Validation to Table Attributes.Ā However, in PhixFlow version 11.3+, where a form field is backed by a relational attribute, the validation set on the table attribute isĀ notĀ used.

For applying pre-set validation (e.g. mandatory, min/max length) to form fields on screens, see below, and for bespoke validation, see Custom Validation.

Table of Contents

Form Field Validation

Video Tutorial

Form Field Validation - Mandatory Field

Setting a form field as mandatory.

  1. Right-click on the form field you would like to set as mandatory and choose  Set ValidationĀ 
  2. The properties will open on the right, scroll down to the Validation section
  3. Click on the tickbox next to Mandatory
  4. Then toggle this onĀ 
  5.  ApplyĀ your changes
  6. If you are using the Serene Grey Template, the following will be seen:
    1. The form field header text will show with an asteriskĀ *
    2. The form fields that fail validation will have a red outlineĀ after changing the value or when a form is loaded with data in it, such as an edit form


For True/False (Boolean) fields, only Mandatory is available. When set, validation will fail if the field is set to false and an error will show.

Form Field Validation - Minimum/Maximum Length

  1. Right-click on the form field you would like to setĀ a minimum or maximum length for and choose  Set ValidationĀ 
  2. The properties will open on the right,Ā scroll down to the Validation section
  3. Click on the tickbox next to Validation Type
  4. Next to Validation Type,Ā clickĀ 
    1. A validation type can also be selected from the drop-down, if the desired validation exists, or edited by clicking the Validation Type hyperlink
  5. The Validation Type properties open, seeĀ Validation Type
  6. Enter:
    1. Name, this should be indicative of its purpose. For example, minimum name length
    2. Base Type, select the type of data. For example, different data types have different parameters such as numbers specifying the maximum value
    3. Minimum Length (optional),Ā sets the minimum number of characters. For example, 2
    4. Maximum LengthĀ (optional), sets the maximum of characters. For example, 150.Ā  If left blank there is no maximum
    5. Error Message (optional), enter a custom message or leave blank for the defaultĀ message. This is shown when the field fails the validation check and you mouseover the field
  7.  ApplyĀ your changes
  8. If you are using the Serene Grey Template, the form fields that fail validation will have a red outlineĀ after changing the value or when a form is loaded with data in it, such as an edit form

Form Field Validation - Matching a Given Pattern

  1. Right-click on the form field you would like to setĀ a pattern match for and choose  Set ValidationĀ 
  2. The properties will open on the right, scroll down to the Validation section
  3. Click on the tickbox next to Validation Type
  4. Next to Validation Type, clickĀ 
    1. A validation type can also be selected from the drop-down if the desired validation exists or edited by clicking the Validation Type hyperlink
  5. The Validation Type properties open, seeĀ Validation Type
  6. Enter:
    1. Name, this should be indicative of its purpose. For example, minimum name length
    2. Base Type, selectĀ String
    3. Pattern, define a pattern the input must adhere to in the form of a regular expression. Pattern examples are provided at the end of this section
  7.  ApplyĀ your changes
  8. If you are using the Serene Grey Template, the form fields that fail validation will have a red outlineĀ after changing the value or when a form is loaded with data in it, such as an edit form


Example Patterns

SeeĀ Regular ExpressionsĀ for details on how to create a pattern.

DescriptionPattern
Alpha Only[A-Za-z]
Alpha Numeric including, hyphens, underscores, spaces, ampersands and full stops

[A-Za-z0-9\s\-_.)(\/\-\&]

Numeric Only[0-9]
Email

^[a-zA-Z0-9!#$%&'*+/=?^_ā€˜{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_ā€˜{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

Specific words e.g. hello or world\b(hello|world)\b

In PhixFlow 11.1.4+, validations containing invalid regular expressions can be created but the validation tooltip for the associated form field(s)Ā will display anĀ invalid message.

Editing an Existing Validation

To edit an existing validation:

  1. Opening an existing Validation
    1. Open the table attribute that has theĀ  Validation TypeĀ applied to it.Ā In the Validation section click the Validation Type link to open it.
    2. Alternatively, in the Repository open theĀ  Validation TypeĀ section within your application or withinĀ the package associated to your application and double-click the Validation Type you wish to change.
  2. Make the required changes andĀ  ApplyĀ your changes.Ā 

Editing Existing Validations

Changes to an existingĀ Ā Validation Type impact everywhere it is currently being used. If you are changing aĀ Ā Validation TypeĀ from a shared package, these changes can impact other applications also using this package. Therefore, we recommend adding new validation if you have a specific requirement.

Actionflow Validation Options

Prevent Saving of Invalid Fields

A validation check is performed before running the Actionflow and will not run the Actionflow if the validation check fails. For example, when a user presses the Save button on a form, any validation on the form fields will be triggered, and stop the form being saved with validation errors.

The form will highlight the fields that have failed validation and will not allow the user to proceed until the validation issues have been resolved.

Allow Saving of Invalid Fields

Actionflows can be configured toĀ run even if validation errors occur. For example, if a user does not complete all mandatory fields on a form, they can still save their progress and complete the form later.

The form will highlight the fields that have failed validation and will still give the option to save the form.

  1. Open the Actionflow
  2. In the Settings above the canvas, click Properties
  3. In the Basic Settings, toggle onĀ Ā Allow to Run with Validation ErrorsĀ