Running Flow Actions From A Rule
- 04 May 2021
- 2 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Running Flow Actions From A Rule
- Updated on 04 May 2021
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
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 (Flows, converter Flows, etc) that run instead of the true or false outcomes that are outputted by logical Rules.
Example
This example will use two Flows (Admin Flow, Non Admin Flow) that will send a Popup Notification when successfully ran. The Action Rule will test whether a given email address contains the string "admin@". If it does, the Admin Flow will run. If it does not, the Non Admin Flow will run.
- To create the Popup Notification, click CREATE FLOW in the Designer Project, select the Default Flow, and click CREATE. Enter a name for the Flow (Admin Flow) and click CREATE.
- On the Flow Designer, click the Done path and select the Show Popup step from under the Favorite Steps category, then click ADD.
- Select the Show Popup step. Under INPUTS on the Properties panel, enter a Subject (Admin Flow) and Message (The Admin Flow has run). Then, connect the Done path to the End step.
- Then, save and close the Flow Designer to return to the Designer Folder.
- Repeat steps 1-4 to create a second Flow with a different Subject (Non Admin Flow) and Message (Non Admin Flow has run).
- From the Designer Folder, click the CREATE RULE button, select Default under Statement Rule, and click CREATE. Enter a name for the Rule (Action Rule), and click CREATE.
- Next, define the input data for the Rule by clicking the SETUP INPUT DATA button.
- On the Input Data window, enter "EmailID" in the Name field. Leave the Type field as the default selection of String. Then, click CLOSE to close the window.
- In the If Statement block, create a Rule statement that will evaluate if the EmailID contains the string value "admin@".
- In the Result statement block under Return True, click Add, select Run Flow, and click Pick.
- From the Pick Entity window, select Admin Flow and click PICK.
- In the Else statement block, click Add, then select Run Flow and click Pick. Then, select the Non Admin Flow and click PICK to return to the Rule Designer.If creating a Unit Test for a Rule, select the Run Actions option under UnitTests on the Properties panel. This will allow any Flow actions added to a Rule's output to run when debugging using a Unit Test. To learn how to create a Unit Test, see Running Unit Tests on a Flow.
Debug
- To ensure the Rule works, select Debug on the top panel of the Rule Designer.
- In the Email ID textbox, enter an email address with "admin@" (admin@email.com) and click Run Capturing All.The Rule will evaluate as True and run the Admin Flow since the email provided contained admin@.
- Click CREATE NEW SESSION and enter an email address that does not contain admin@ (example@email.com) and click Run Capturing All.
The Rule will evaluate as False and run the Non Admin Flow since the email provided did not contain "admin@".
Was this article helpful?