Running Flow Actions From A RuleLast Updated: 05/03/2018 Introduced in Version: 2.0
Rules evaluate a data input and can be configured to return an outcome that is dependent on whether the input satisfies the rule’s conditions. Action Rules define specific actions (or flows) that will be run, as opposed to the more typical True or False outcomes that are outputted by logical rules.
To create an action rule in the Rule Designer, change the Rule Type in the Properties panel to Action Rule. The structure of the rule statement in the Text Rule View will update with new syntax for defining the actions that will be taken as a result of the conditions being satisfied or not.
Our example begins with the assumption that the folder Designer Folder contains two flows: Admin Flow and NonAdmin Flow. These flows will send an Admin and NonAdmin popup notification. Our new action rule will test whether a given email address contains the string admin@. If it does, the flow Admin Flow will run. If it does not, the flow NonAdmin Flow will run. These two flows simply send a notification noting the flow name to show which flow was initiated.
In the Rule Designer, change the Output Rule Type from Logical Rule to Action Rule. This tells our rule that it should return an action (or flow) rather than a logical construct like True or False.
Next, define input for our rule by clicking the orange Add New link.
The first change seen, as a result of our new rule type, is the addition of new syntax in the Text Rule View tab. The Then > Execute and Then > Else Execute anchors are where the actions to occur as a result of evaluating this rule are defined.
The first part of the rule is the condition against which inputs will be evaluated. Build this condition by clicking the “If” (Add) icon and selecting Add Condition.
Our rule will evaluate the input defined earlier, EmailID, to see if it contains the string admin@. Therefore, our condition will include the input anchor EmailID, the operator Contains, and the value “admin@.”
Next, add the actions that will represent our rule results. For Then > Execute, hover select (Add).
In the event that an email address does not satisfy our condition, we want to run the Non Admin flow. For Then > Else Execute select (Add) , and then select Non Admin Flow from the list of available flows.
This completes our action rule. Save the rule and run it in the debugger.
At the prompt provide an email address. Enter the email address.
The rule evaluates the email as satisfying the rule’s condition, and then run the flow Admin Flow.
If we supply the debugger with the email address not containing admin@ the NonAdmin flow is executed.