Evaluate Dynamic Expression As RuleLast Updated: 07/25/2016 Introduced in Verision: 2.0 |
Expression Steps are specially designed to evaluate calculations in one step within a Flow. These Steps can be found under Data > Numbers Category in the ToolBox in the Flow Designer. The Evaluate Dynamic Expression As Rule Step is unique in the way that it allows end User to pass some values into Expression which makes it Dynamic. The other key feature of the Output of this step is the Type Boolean.
Example
In this Example we will create the Flow that let’s the User input a Number and tells the User if the Number is Odd or Even.
We begin with navigating to the Designer Folder and Selecting Create Flow.
Name the Flow and click Create to Continue.
The Flow Designer opens…
Enter Number form was designed for this example.
We locate Enter Number form in Flow Designer’s start-up window under Flows, Rules, Forms and Reports > Forms[Interaction] > [Current Folder] and click Add to add it to the workspace.
Enter Number Form designed as follow… It has a Title that is a Label. It has an Action Button to proceed as well. Also, It has a Label and a Number Box for User’s input.
Next, under Data > Numbers category locate Evaluate Dynamic Expression As Rule Step and drag it to the workspace. Connect it to the Enter Number Form Step’s outcome. Mention that Evaluate Dynamic Expression As Rule Step has two outcome paths because the outcome should be Boolean.
Next, from Evaluate Dynamic Expression As Rule Step’s Options we pick Show Mapping Editor.
In the Mapping Editor we choose Text Merge.Plain type of input for the expression value.
Next, we click Show Editor to open Merge Text Editor.
In the Merge Text Editor we drag NumberToCheck value from the Flow’s Data which refers to the User’s input. Next we finish our formula that defines if the Number is Odd or Even. In this case the Formula defines if the Number is Even, so the True outcome path should tell the User that the Number is Even. And we click Ok to close and save Text Merge Editor.
We can click Ok to save and close Mapping Editor and return back to our Flow Designer.
Next we create or drag to the workspace Number Is Odd Form and connect it to the False outcome from Evaluate Dynamic Expression As Rule Step.
The Number Is Odd Form is designed as follow… It has an Action Button to close the Form and two Labels to inform the User that the number is odd. One of the labels is created from the Flow’s Data Value to show the Number that User Input.
Next, we drag or create Number Is Even Form to the workspace. This Form is designed the same way as Number Is Odd Form. We connect this Form to the True outcome from Evaluate Dynamic Expression As Rule Step. Next we can connect all Steps as follow.
This completes our Flow. Click Debug Flow link from the top panel of the Flow Designer to test our Flow.
Note that in Decisions version 3.5 and above, you’ll need to click the Test Flow link to access the Debugger.
Enter an Odd Number in the first Form in the Debugger and click Check to Check it.
Result Form Shows us the Number we’ve input and tells us that it is odd. Click Done to close this Form.
We can see the Diagram that tells us that the Flow ran with no Errors and it ran on the False path.
Next, rerun the Flow in the Debugger and enter the Even Number. Click Check to check it.
Result Form Shows us the Number we’ve input and tells us that it is even. Click Done to close this Form.
We can see the Diagram that tells us that the Flow ran with no Errors and it ran on the True path.