Validating Form Data with a Flow
  • 19 Jan 2022
  • 2 Minutes to read
  • Dark
    Light

Validating Form Data with a Flow

  • Dark
    Light

Article Summary

Overview

The following features are considered legacy content.

It is not recommended to introduce these features to new projects. Support for these features have been maintained just to grant time for projects to shift away from legacy content towards the new preferred method: Active Form Flows. 

Failure to do so may result in losing work involving legacy content in the future.

Decisions offers the use of a Flow as a Validation Rule on a Form. This is beneficial because it extends Flow Validation Rules' capabilities to allow for more advanced validations that can be applied to different Form Controls. After evaluating the inputs, a Validation Flow would return a collection of issues that contain data about which Form Control the error is applied to.

Additional Information
To learn about how to use Statement Rules as data validation, see: Validating Form Data With a Rule.

Example

This example will demonstrate using a Flow as a Validation Rule applied to a Checkbox Form Control. The Flow Validation Rule will execute the Flow and return the expected response based on the Flow and the user action on the Form. Unlike Rule Validations, Flow Validations cannot be applied to Form Layouts (i.e., a Grid).

  1. In a Designer Folder, select the CREATE FLOW button. 
  2. When the Create Flow dialog appears, select Flow, name the Flow, then select CREATE.
  3. Select the Done outcome path of the Start step.
  4. In the Add After dialog, select the Show Form step in the Favorite Steps category. Select ADD.With the Show Form step selected, in the Properties panel, select PICK OR CREATE FORM.
  5. Select CREATE under Create New. Choose Form. Name the Form, then select CREATE.

  6. In the Add Validation Rules dialog, name the Validation, change the Validation Source to Flow.
  7. Select PICK FLOW.
  8. In the Form Validation Flow, select SETUP INPUT DATA.
  9. Type CheckBox as the Name and change the type to Boolean.
  10. Add a Value is True step from the Rules > System Defaults > Default Form Validation Rules category.
  11. With the step selected, navigate to the Properties panel. Under Inputs > Value, select CheckBox from the Flow.
  12. Connect the True outcome path to the End step. 
  13. On the False outcome path, add a Create Data step.
  14. With the Create Data step select, navigate to the Properties panel. Under Data > Data To Create, select Show Editor.
    1. Type Validation as the Name and search for and select FormValidationIssues as the Type. Select CLOSE to save and close.
  15. Under Inputs > Validation, change the mapping type to Constant. Select the pencil icon to open the Edit dialog. 
  16. In the Edit dialog, select ADD NEW.
  17. In the Add Validation Issues dialog, under Settings, check IsBreakingIssue. Under Validation, set the Break Level to Fatal, type a message, and type the control's Data Name. Select OK.
  18. Select the End step, under Inputs > Form Validations, choose Validation
  19. Save and close the Form Validation Flow.
  20. Back in the Add Validation Rules dialog, select UPDATE INPUTS. 
  21. Under Rule Inputs, select the pencil icon next to CheckBox.
  22. In the Edit Rule Inputs dialog, change the Input Type to Form Component.
  23. Select Terms and Conditions for the Form Data Name
  24. Set RunOnValueChanged to true.
  25. Select OK.
  26. Back in the Add Validation Rules dialog, under RULE EXECUTION, select Run Rule On All Outcomes.
  27. Under RULE EXECUTION > Triggers select Terms and Conditions.
  28. Select OK. Save and Close the Form Designer.

Debug

  1. In the Flow Designer, select Debug in the top action panel. Select START DEBUGGING. 
  2. The Debugger will display the Form. Select the Done button to attempt to close the Form without the Terms and Conditions selected.
  3. The validation warning and red boxes will show. Set the CheckBox to True and close the Form.



Was this article helpful?