Form Outcome 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 Outcome behavior.
In this example we will create a Rule that will be used to control our Form’s behavior. Our Rule will create a condition to show Notification when user selects Admin email from the list of emails on the Form.
We begin in the Designer Folder with clicking Create Rule > Create Rule on the Folder Actions panel.
Next, we name the Rule and click Create to proceed to the Rule Designer.
In the Rule Designer we click Add New link to add new Rule Input Data.
In the Add Rule Input Data pop-up window we Name our input, select its Type as Account and check Is List check-box.
Then, we can click Ok to save and close this pop-up window.
Back in the Rule Designer Wizard, in the Output section we change the Behavior Type to Form Rules.
Next, we click Add New Rule Step button to start creating our Rule.
First, we expand our Rule Input data that is a List of Accounts, and select EmailAddress [List of String]. Click Next to continue.
Here, we expand Text Rules category and select List Contains. We click Next to proceed…
Finally, we define Constant email@example.com condition for the List of All Accounts’ Emails. Click Done to complete this Rule Phrase.
In the resulting pop-up we click Close to close Rule Designer Wizard. And, this completes our Rule. We can save our Rule and close Rule Designer.
Next, in the Designer Folder we click Create Flow button to create a new Flow.
We name the Flow and click Create to proceed to the Flow Designer.
In the Flow Designer we add GetAll step from All Steps [Catalog] > Integration > Internal Services > AccountService category in the Flow Designer Wizard.
Next, we expand Flows, Rules, Forms and Reports > Forms [Interaction] category and add [Pick or Create Form] step to our Flow.
In the resulting pop-up window we click Pick or Create Form link. Then, we name the Form and click Create to proceed to the Form Designer.
In the Form Designer we add Button control from Actions category in the ToolBox. Next, we add Check Box List component from the List category in the ToolBox.
Then, we need to configure this Check Box List component. First, we define List Items Data Name. We use Type Picker to select Account Type for this list. Next, define Selected Item Data Name, and use our Button control as an Optional Outcome for this list.
Next, we pick EmailAddress for Display Field option…
To navigate to the Form’s properties we select Explorer in the ToolBox. In the Explorer we select Surface component and click Properties.
In the Surface Properties we locate Outcome Rules configuration and click Add New link.
In the resulting pop-up window we define Group Name, Outcome Path, and Triggers for our Rule and click Add New link to configure Rule Data.
In the Add Rules window we provide RuleName and use Rule Picker to select the Rule that we have created previously in this tutorial.
After we picked the Rule we need to configure Inputs to this Rule. Select an Input to our Rule and click Edit.
In the Edit Inputs window we select Form Component option from the InputType drop-down list…
Next, from FormDataName drop-down list we select SelectedEmail which is a data name for the user’s selection from the list of Emails. Then, we can save and close all pop-up windows for Outcome Rule configuration. This completes our Form. We can save and close Form Designer to return back to the Flow Designer.
In the Flow Designer we connect Done outcome from our Form to the End Step. Then, we add Show Popup step from the Favorite Steps category in the Flow Designer Wizard to the AdminEmail outcome from our Form. This outcome from our Form was created with Outcome Rule. So, in this case we want to show Notification to the user when the Outcome Rule evaluates True (in other words, when user selects Admin email).
In the resulting window we configure Subject and Message for our Show Popup step and click Add…
We connect Steps in our Flow in the following manner…
Next, we select Show Mapping Editor from Form step options in our Flow.
In the Mapping Editor we connect the outcome from GetAll step to the Check Box List in our Form to populate it with all Accounts in the system. We can save and close Mapping Editor when finished.
This completes our Flow. We can click Debug Flow link from the top panel in the Flow Designer to test our Flow.
Note that in Decisions version 3.5 and higher, you’ll need to click Test Flow to access the Debugger.
Our Form opens in the Debugger and the Check Box List is populated with all Accounts. We can select several Accounts from this List…
When we select firstname.lastname@example.org email from this List we trigger our Outcome Rule. As expected, Notification pops up and our Form resets.
We can select some emails again and click Done to close the Form.
Our Flow runs successfully to the End Step with no issues…