Form Validation Flow
  • Updated on 22 May 2017
  • 4 minutes to read
  • Print
  • Dark
    Light

Form Validation Flow

  • Print
  • Dark
    Light

This tutorial demonstrates how to use Flow as a Validation Rule on the Form . To learn about Validation Rules , please click here . Flow Validation Rule can be used for designing more advanced validations and applying them to different components on the Form . Validation Flow evaluates inputs and returns a collection of Form Issues that contain data about controls it should apply to, message it should display and breaking level of the issue.
Example:
In this example we are going to create a simple Flow with a Form . Our Form is going to have a Text Box component. We are going to apply Flow Validation Rule for this Text Box component.

We begin in a Designer Folder with clicking Create Flow on the Folder Actions Panel.
2018-01-08_114418.png

Then, we Name the Flow and click Ok to proceed to the Flow Designer .
2018-01-08_114524.png

In the Flow Designer we add Show Form component from Favorite Steps category.
2018-01-08_114549.png

Next, we Name the Form and click Create to proceed to the Form Designer.
2018-01-08_114647.png

In the Form Designer we add Button control and Text Box control to our Form .
Note: we need to remember Data Name for the Text Box control because we are going to use it later in this tutorial.
2018-01-08_114935-1024x588.png

Then, we navigate to Form Settings by clicking outside of the work-space in the Form Designer . We locate Validation Rules under Form Rules section and clickAdd New .
2018-01-08_115041.png

In Add Validation Rules window we Name our rule. Then, we pick Flow as Validation Source and click Create to build our validation Flow .
2018-01-08_115135.png

In the resulting window we Name the Flow and click Ok to proceed to the Flow Designer.
2018-01-08_115230.png

In this Flow we can build any logic to evaluate our validation. 
First, we need to add a Flow Input data. We are going to evaluate this data and decide if validation issue should be returned.
We select Start Step in our Flow and under Flow Input Data settings we click Show Editor.
2018-01-08_115322-1024x768.png

In the Data Definitions window we create a String and close the window to save and continue.
2018-01-08_115358.png

Then, we add Create Data step from Favorite Steps category.
2018-01-08_115438-1024x768.png

Under Data Definitions settings for Create Data step we click Show Editor.
2018-01-08_115506-1024x768.png

Here we are going to define Form Validation Issue data to use as an outcome from our Flow .
We Name our variable and locate FormValidationIssue Type . By default we set Null value for this variable.
2018-01-08_115642-1024x766.png

Back in the Flow Designer we add String Equals – Case Insensitive step from All Steps [Catalog] > Data > Text category.
2018-01-08_115821-1024x768.png

This is a Rule that has two input values to compare.
We locate Inputs settings and define value1 Constant ‘brake’ . For value2 we Select Value of our Flow Input (My Text) .
2018-01-08_115939-1024x776.png

Then, on True outcome from String Equals – Case Insensitive step we add Mapping Step from All Steps [Catalog] > Data category.
To learn more on how to use Mapping Step, please click here .
With this step we are going to build our Validation Issue because we know that if our Flow executes down this path then our validation should be broken.
2018-01-08_121633-1024x767.png

In the Mapping Step settings we locateValidation Issue and useBuild Data Mapping Type.
2018-01-08_121816-1024x768.png

We are interesting to Build few properties: Break Level, Message, andData Name.
We pick Constant Break Level. It can be either Fatal or Warning .
Then, we create a Constant Data Name . This should match a Name of the control on the Form where we want to display validation. In this case this is a name of our Text Box.
Finally, we are going to use Text Merge.Plain Mapping Type for Message property to demonstrate that we can build a dynamic text for our Validation Issue . ClickShow Editor
2018-01-08_122137.png

In the Text Merge Editor we use our Flow Input (My Text) to create a Validation Message . When finished we can click Ok to save and continue.
2018-01-08_122230.png

Then, we connect the outcome from Mapping Step and False outcome from String Equals – Case Insensitive step to the End Step .
For the End Step we need to map Form Validations output data. In the End Step Settings we locateForm Validations Input and use Build Data Mapping Type . Then, for Validation Issues property we are going to Build Array . For Item 0 in the array we Select Value of Validation Issue that we created in our Flow .
2018-01-08_122531-1024x770.png

This completes our Flow . We can save the Flow and close Flow Designer.
2018-01-08_122705.png

Back in the Edit Validation Rules window we define our Triggers and Edit ‘My Text’ Flow input.
2018-01-08_123004.png

For ‘My Text’ input we use data from our Text Box Form component .
2018-01-08_123159.png

This completes our Form Design . We save the Form and close Form Designer .
2018-01-08_123238-1024x610.png

In the Main Flow we connect Form outcome path to the End Step . On the top panel of the Flow Designer we click Debug Flow to test our Flow .
2018-01-08_123444.png

Form pops up in the Debugger
2018-01-08_123517.png

If we type ‘brake’ in ourText Box , we should be able to see our validation message.
2018-01-08_123554.png

If we try to Submit our Form we will see Validation issue on the Button .
2018-01-08_123616.png

If the input is valid, we can successfully submit the Form .
2018-01-08_123636.png

Was this article helpful?