Auto Exiting Form Based on RulesLast Updated: 07/15/2016 Introduced in Verision: 2.0 |
A form displays controls that allow a user to perform an action, such as enter data, display a report or folder, or manage entities. You can create a flow that, when run, opens a form.
It is possible to create a custom Rule that can be used to control Form’s behavior.
Create a new flow in which the form will be placed. In the Toolbox panel, expand the category Forms [Interaction] > [Pick or Create Form], and drag a form to the workspace.
Example
In this example we will create a Rule that will be used to control our Form’s behavior. Our Rule will cause the form to Auto Exit when user enters “exit” into the Form’s TextBox.
We begin with creating new Rule.
Navigate to the Designer Folder and click Create Rule > Create Rule
Name our Rule and click Create to continue…
First, In the Rule Designer in the Start Rule Wizard we locate Output section. From Behavior Type dropdown we select Form Rules.
Next, we need to Add Input Data for our Rule… So we click Add New under Flow Input Data Box.
We name our Data and select its Type of String.
Click Ok to save our Input Data.
Next, on the workspace we click [+] to Add Condition to our Rule.
In the resulting pop-up window we select our Flow Input Data (Text) and click Next to continue…
From the Text Rules we pick Equals and click Next to continue…
Our string will stay Constant. We define its Value as “exit” and leave Case Insensitive checkbox checked.
Click Close to finish our Condition.
This completes our Rule Step so we can click Close to continue…
This completes our Rule. Save the Rule and close it.
Next, create new Flow by clicking Create Flow in the Designer Folder
Name the Flow and click Create to continue to the Flow Designer.
In the Flow Designer start-up window under Flows, Rules, Forms and Reports > Forms[Interaction] select [Pick or Create Form] and click Add to add it to the workspace.
From this step’s options select Pick or Create Form… Name the form and click Create to continue.
Drag to the workspace a Label, Textbox and Action Button.
Next, select Surface from the Explorer.
In the Surface’s Properties locate Outcome Rules and click Add to add a new rule that will control our textbox.
In the resulting pop-up window we give our Rule Group Name and name the Outcome Path. Next, we check TextBox1 : Exit checkbox as a Trigger. Click Add to add a Rule to our trigger.
Next we name our Rule and pick our Exit Rule that we created in the first step of this example for this form.
Now we need to Edit our Rule’s inputs.. Click Edit.
In the resulting pop-up window change InputType to Form Component. From the FormDataName’s dropdown pick our TextBoxe’s Name (Text).
Click Ok to save and close all popped-up windows. Save and close our Form. Back in the Flow Designer connect all steps as follow…
This completes our Flow. Save the Flow and click Debug Flow from the top panel of the Flow Designer to test our Form. First in the Debugger enter something into the textbox but “exit”… Mention that the Form’s Behavior is standard and we can proceed by clicking our Action Button (Done).
Note that in Decisions version 3.5 and above, you’ll need to click Test Flow to access the Debugger.
Debug Diagram shows us that the Flow were executed with no errors and came to the end step using Done outcome…
Rerun the Flow and this time enter “exit” into the textbox… Mention that as soon as we finish typing “exit” our form auto exits…
The Debug Diagram shows that the flow ran with no errors again but this time it came to the end step on Exit outcome path.