Validating Form Data with a Flow
  • 09 Mar 2022
  • 2 Minutes to read
  • Dark
    Light

Validating Form Data with a Flow

  • Dark
    Light

Article summary

Overview

Validation Rule may choose to build their logic within a Flow rather than as a Rule. 

Rules creating with a Flow source extends Flow Validation Rules' capabilities to allow for more advanced validations. After evaluating the inputs, a Validation Flow would return a collection of issues that contain data about which Form control producing errors.

Unlike Rule Validations, Flow Validations cannot be applied to Form Layouts (i.e., a Grid).


Example 

  1. In a Designer Folder, create and name a new Flow. It will automatically open in the Flow Designer.
  2. After the Start step, add a Show Form step from the Favorite Steps category. Create and name a new Form. It will automatically open in the Form Designer.
  3. Add a Check Box control to the Form named 'I under Terms and Conditions' and a Button named 'Done'.
  4. In the Form's Properties > Form Rules, select ADD next to Validation Rules to create a new validation rule.

  5. In the Add Validation Rules dialog, name the validation and change the Validation Source to Flow. Select PICK OR CREATE FLOW and create a new Flow.

  6. In the Form Validation Flow, select SETUP INPUT DATA. Type CheckBox as the Name and change the type to Boolean.

  7. Add a Value is True step from the Rules > System Defaults > Default Form Validation Rules category.
  8. With the step selected, navigate to the Properties panel. Under Inputs > Value, select CheckBox from the Flow.

  9. Connect the True outcome path to the End step. 
  10. On the False outcome path, add a Create Data step. View the Create Data's Properties panel and select SHOW EDITOR.

    Type Validation as the Name and search for and select FormValidationIssues as the Type. Select CLOSE to save and close.

  11. For the Validation input, change the mapping type to Constant. Select the pencil icon to open the Edit dialog. 
  12. In the Edit dialog, under Settings, check IsBreakingIssue. Under Validation, set the Break Level to Fatal, type a message, and type the Checkbox control's Data Name. Select OK.

  13. Connect the Create Data step to the End step. Select the End step. Under Inputs > Form Validations, choose Validation
  14. Save and close the Form Validation Flow.

  15. Back in the Add Validation Rules dialog, select UPDATE INPUTS. Under Rule Inputs, select the pencil icon next to CheckBox.
  16. In the Edit Rule Inputs dialog, change the Input Type to Form Component. Select Terms and Conditions for the Form Data Name. Set RunOnValueChanged to true. Select OK to confirm.

  17. Back in the Add Validation Rules dialog, under RULE EXECUTION, select Run Rule On All Outcomes. Under Triggers, select the Terms and Conditions Check Box.
  18. 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.

For further information on Forms, visit the Decisions Forum.

Was this article helpful?