Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

Overview

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

Validation can be applied at the

Insert excerpt
_tables
_tables
nopaneltrue
 level. Validation set against an attribute in a table is applied everywhere the attribute exists. See Table Attribute Validation.

Validation Details

Validation is checked On Blur, which means once the user leaves the field the validation is run. It is checked when an existing record is loaded. It can also be checked when the user submits their data via a form.

Validation Type Check

For version 10.1 and above.

If a form field on a screen is backed by an attribute, PhixFlow ensures that it only accept values valid for that attribute. For example, form fields backed by integer attributes check if the value provided is a valid integer without any decimal numbers. This can be overridden by setting a custom Validation Type on the field.

Error Messages 

Where validation fails, an error will be displayed by default when a user places their mouse over an invalid field explaining what this issue is. Conditional formatting can be used to highlight the field and display the error message. The error details are accessed using the internal variable _field.errors.

Adding a Confirmation Message

See 1.13 Confirmation Message Configuration.

Form Field Validation

See 1.10 Validation.

Worked Example

Here is a worked example using the Shop the Retail Data (available from the Learning Centre).

In this example, we are using:  

  • Shop Customer Form screen containing blank input fields, set up to create a new staff member  - this screen was created using the Edit Form template
  • A Shop Customer Duplicate Popup screen containing a grid of the FirstName and LastName attributes from the Shop Orders data, dynamic text fields and a background filter to filter the grid  - this screen was created using the Tile no Buttons template
Tip

If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Intermediate Application. For these example, we'll be working on the Check button on the Shop Customer Form, and the Shop Customer Duplicate Popup screen. 

GIF/SCREENSHOT OF FINISHED RESULT 

 

Identify If New Customer Already Exists

In this example, we'll create an Actionflow that checks if a new customer's name matches any existing customers, then shows this information in a pop up.

Image Added

Initial Setup

  1. On the Shop Customer Form screen, add a new Actionflow to the Check button
  2. Configure the Shop Customer Form as the input data for the Actionflow
  3. Map into the Actionflow the attributes, first_name and last_name
  4. Create a 
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     action - this will be used to process the results of a lookup
  5. Drag the 
    Insert excerpt
    _input
    _input
    nopaneltrue
     node 
  6. Hover over the Calculate action and choose Add Lookup, then click onto the canvas to create a 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     action
    1. Primary Table: Shop Customers

Configure the View

  1. Click on The Output Attributes window will pop up for the 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     action to open its Properties
  2. In the Output Attributes section, click the Attribute icon and drag across the attributes, firstTick first_name and last_name and select Next
  3. For the Incoming Mappings, map the first_name and last_name attributes, then select Next
  4. For the Outgoing Mappings, map the first_name and last_name attributes
    1. You may wish to rename the Outgoing Mappings (right-click and 
      Insert excerpt
      _edit
      _edit
      nopaneltrue
      ) to make them easier to reference
    2. Select Confirm and create filter
  5. Create a filter on the View action to match the name being input on the input form to the name in the data
    1. Add two filter conditions:
    2. Ensure Case Sensitive is toggled off to capture names being entered in upper and lowercase

      Note

      This could be changed to, Where ALL of the following are true, if you wanted to only find existing customers that match the first and last name.

    Click on the lookup connector and map the first_name and last_name attributes for the Incoming and Outgoing Mappings

    1. You may wish to rename the Outgoing Mapping (right-click and  Insert excerpt_edit_editnopaneltrue) to make them easier reference
      Expand
      titleCheckpoint

      Image Added


Configure the Calculate Action

  1. Click on the Calculate action and create 3 Output Attributes:
    1. Create an Output Attribute to count the records being returned from the lookup

      Expand
      titleHow?


      1. This will be mapped onto a dynamic text field to display how many duplicate records have been found
    2. Create an Output Attribute to display the First Name being returned from the lookup

      Expand
      titleHow?


    3. Create an Output Attribute to display the Last Name being returned from the lookup

      Expand
      titleHow?

      Image Added


Map Data to Popup Screen

  1. Create an 
    Insert excerpt
    _action_screen
    _action_screen
    nopaneltrue
     action to open the Shop Customer Duplicate Popup screen
  2. Connect the Calculate action to the Open Screen action
  3. Map the three Output Attributes from the Calculate action to the relevant fields on the screen
    1. Open the screen and look in the layers to see the names of the fields

      Expand
      titleCheckpoint

      Image Added


Testing

  1. Close and reopen the Customer Form
  2. Insert excerpt
    _lock
    _lock
    nopaneltrue
     the screen and populate the First Name and Last Name fields, then select Check
    1. You can see that the Actionflow is working because the Shop Customer Duplicate Popup screen will open showing the number of potential duplicates found and their name(s)
    2. Test this a number of times to see the different resultsresults 
  3. Once you have verified your Actionflow is working, you can tidy up the screen by hiding the two dynamic text components that the Actionflow is mapping to


Image Modified