Form Outcome Rules

Last 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.

 

Example:

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.

 createRule

Next, we name the Rule and click Create to proceed to the Rule Designer.

 nameRule

In the Rule Designer we click Add New link to add new Rule Input Data.

 addNewInput

In the Add Rule Input Data pop-up window we Name our input, select its Type as Account and check Is List check-box.

 ruleInputDataDefined

Then, we can click Ok to save and close this pop-up window.

 dataForTheRule

Back in the Rule Designer Wizard, in the Output section we change the Behavior Type to Form Rules.

 behaviorForForm

Next, we click Add New Rule Step button to start creating our Rule.

 addNewStep

First, we expand our Rule Input data that is a List of Accounts, and select EmailAddress [List of String]. Click Next to continue.

 pickListFirst

Here, we expand Text Rules category and select List Contains. We click Next to proceed…

 listContains

Finally, we define Constant admin@decisions.com condition for the List of All Accounts’ Emails. Click Done to complete this Rule Phrase.

 emailToCheck

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.

 closeRuleWizard

Next, in the Designer Folder we click Create Flow button to create a new Flow.

 createFlow

We name the Flow and click Create to proceed to the Flow Designer.

 nameFlow

In the Flow Designer we add GetAll step from All Steps [Catalog] > Integration > Internal Services > AccountService category in the Flow Designer Wizard.

 getAllAccounts

Next, we expand Flows, Rules, Forms and Reports > Forms [Interaction] category and add [Pick or Create Form] step to our Flow.

 addFormFirst

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.

 nameFirstForm

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.

 addCheckBoxList

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.

 typeForCheckBoxList

Next, we pick EmailAddress for Display Field option…

 displayFieldForCheckBox

To navigate to the Form’s properties we select Explorer in the ToolBox. In the Explorer we select Surface component and click Properties.

 selectSurface

In the Surface Properties we locate Outcome Rules configuration and click Add New link.

 addOutcomeRule

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.

 addNewRuleForOutcome

In the Add Rules window we provide RuleName and use Rule Picker to select the Rule that we have created previously in this tutorial.

 pickRule

After we picked the Rule we need to configure Inputs to this Rule. Select an Input to our Rule and click Edit.

 editInputs

In the Edit Inputs window we select Form Component option from the InputType drop-down list…

 FormComponentInput

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.

 selectedEmailComponentForRule

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).

 addShowPopUp

In the resulting window we configure Subject and Message for our Show Popup step and click Add

 popUpConfiguration

We connect Steps in our Flow in the following manner…

 flowStepsConnection

Next, we select Show Mapping Editor from Form step options in our Flow.

 showMappingForForm

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.

mappingForFormDone

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.

3.5 Test Flow Shot

 debugFlow

Our Form opens in the Debugger and the Check Box List is populated with all Accounts. We can select several Accounts from this List…

 selectAccounts

When we select admin@decisions.com email from this List we trigger our Outcome Rule. As expected, Notification pops up and our Form resets.

 adminSelected

We can select some emails again and click Done to close the Form.

 terminateFlow

Our Flow runs successfully to the End Step with no issues…

 flowTerminatedInTheDebugger

 

Additional Resources