Running Flow Actions From A Rule
  • Updated on 09 May 2013
  • 3 minutes to read
  • Print
  • Dark
    Light

Running Flow Actions From A Rule

  • Print
  • Dark
    Light

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.

Example

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.
From the Designer Folder , begin by clicking the Create Rule button, and selecting Create Rule
2017-12-29_131146.png

Name the new rule Action Rule and click OK .
2017-12-29_131415.png

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.
2017-12-29_131509-1.png

In the Object Editor popup, name our data input EmailID .
2017-12-29_131631.png

To define our input data type, click the Type selector, located directly underneath the Name input. String is selected by default. In the resulting Entity Select popup, we will select the type String and click OK to close the popup. With our input data defined, click OK to preserve the definition.
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.
2017-12-29_131750.png

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@."
2017-12-29_132059.png

Next, add the actions that will represent our rule results. For Then > Execute , hover select ( Add) .
2017-12-29_132228.png

In the event that an email address satisfies our condition, we want to run the Admin Flow flow, therefore, select Admin Flow from the list of available flows.
2017-12-29_132230.png

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.
2017-12-29_132332.png

At the prompt provide an email address. Enter the email address.
2018-02-02_110131.png

The rule evaluates the email as satisfying the rule's condition, and then run the flow Admin Flow.
2018-02-02_112635.png

If we supply the debugger with the email address not containing admin@ the NonAdmin flow is executed.

Was this article helpful?