Using Form Outcomes
- Updated on 02 Apr 2014
- 3 minutes to read
A form outcome rule evaluates data provided by a control in the form, and when the rule is true, causes the form to take a path.
In this example, a drop-down list has three values: "Very Interested," "Somewhat Interested," and "Not Interested." If the "Not Interested" value is selected, the form automatically exits.
There are three entities created for this scenario:
- A rule that evaluates the user selection in the form. The rule is a logical rule that simply makes a true/false determination if a string matches the value "Not Interested."
- A form that contains the drop-down list, and has the outcome rule applied.
- A flow that contains the form.
User Selection Rule
This rule is a logical rule that simply makes a true/false determination if a string matches the value "Not Interested." In a Designer Projects folder, click on Create Rule > Create Rule . Name the rule and set its behavior to Form Rules .
Click Create .
Next, set the input data for the rule, which in this example, is a single text value for the user's selection from the drop-down list. From the Start Rule window panel, under Rule Data > Rule Input Data , click on Show Editor .
Enter "UserSelection" as the name for the input data, and set its type to string.
Click OK .
In the Rules Designer Start Rule window, select Add New Rule Step button. Select UserSelection and click Next . Expand the Text Rules category and click on Equals . Click Next .
Leave the mapping type as Constant , and enter "Not Interested" in the value field. Click Close . The rule should resemble:
The rule configuration is complete. Save and close the rule.
User Selection Form
In a Designer Projects folder, click on Create Form > Create Form . Name the form and click Create .
Expand the Actions category and drag and drop a Button component into the form. Name the button "OK."
Expand the List category and drag and drop a Drop Down List component into the form.
From the Properties panel, configure the Drop Down List component. Set the input data type to String , and set up the list of static values: "Very Interested," "Somewhat Interested," and "Not Interested." Set the default selection to "Very Interested." Set the output data toOutput Only , and enter the output data name "UserSelection." Check the Required Outcome Scenario checkbox for the OK outcome so that a selection is required.
The next step is to apply the rule to the form. This is done at the Surface level of the form. Click on the Explorer tab, and click on Surface .
Click on the Properties tab. The surface-level properties for the form appear. Scroll down to find theOutcome Rules section. Click on Add .
Enter the group name that represents the set of rules (this example includes only one rule), determine the name of the outcome path, and select what event will trigger the running of the rule group.
Under Rule Data , click on Add . Enter a name for the rule, and click on the Rule field Browse button. Navigate to and select the rule.
Under Inputs , click on the UserSelection input and click Edit . Change the InputType field value to Form Component , and select UserSelection as the data from the form that is providing that input.
Click OK to close the Rule Data screen, then click OK again to close the Rule Group screen.
Save and close the form.
Customer Inquiry Flow
In a Designer Projects folder, click on Create Flow . Name the form and click Create .
The flow will begin by the user browsing to the form just created.
From the Flow Designer's start-up window, expand Flows, Rules, Forms and Reports > Forms [Interaction] , and navigate to where the form resides. Select it and click Add to place the form into the workspace.
Notice the two outcomes from the form, OK and Not Interested .
Connect the two outcome paths to the End step. Save and run the flow. Notice when the user picks "Not Interested," the form exits on theNot Interested path.