Get Required Value From Input Data
  • Updated on 12 Sep 2017
  • 2 minutes to read
  • Print
  • Dark
    Light

Get Required Value From Input Data

  • Print
  • Dark
    Light

This tutorial demonstrates how to dynamically set required fields on the Form . This feature is implemented in Decisions 4.0 . To learn about Required and Optional Outcome scenarios, please go through this tutorial . Sometimes, when we design a Form with some user input controls, it is hard to decide if an input should be required or optional. With this feature, our Flow can make this decision based on some data evaluation prior loading the Form .
Example.
In this example we are going to build a simple Flow with a Form . The Form is going to have a text-box control that may be set to be either required or optional. This will be set as a Form input.
We begin in the Designer Folder with clicking Create Flow on the Folder Actions Panel.
createFlow-3.png

Then, we Name the Flow and click Create to proceed to the Flow Designer .
2018-01-03_150142.png

In the Flow Designer we add Show Form step from Favorite Steps category.
2018-01-03_150303.png

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

Our Form layout looks as following. We have a Label , Text-Box and a Button to submit the Form .
For any user input controls (like Text-Box in this example) we can define an Outcome Scenarios. It may be Required Outcome Scenario (user will not be able to submit the Form without providing input) , Optional Outcome Scenario (user may leave an input empty and be able to submit the Form) , and Not Used (the data provided in the input will not be available in next steps in the Flow).
If we need to decide if an input should be required based on some data evaluation in the Flow , we set it to Optional Outcome Scenario . Then, we locate Data section and checkGet required from input data check-box.
This completes our Form . We can save the Form and close Form Designer.
2018-01-03_150552.png

Back in the Flow Designer we select our Show Form step. In the Edit Step window we can see that our Form has two Inputs . First one is for a text-box and we Ignore it. Second one is a Logical (Boolean) variable that will define if our Text-Box input should be required or optional. In this example we set it to Constant ‘True’ .
2018-01-03_150855.png

Then, we connect the outcome from the Form step to the End Step . This completes our Flow . We click Debug Flow on the top panel in the Flow Designer to test the Flow .
2018-01-03_150956.png

If we try to Submit the Form without providing an input in the Text-Box , we are going to see a validation issue and Form will not be submitted.
2018-01-03_151101.png

Was this article helpful?