- 12 May 2022
- 1 Minute to read
Creating a Rule
- Updated on 12 May 2022
- 1 Minute to read
The most common type of Rule is the Statement Rule. A Statement Rule is configured to compare end-user input data against one or many conditions. These Rules are typically created in "if/then" format, but Rules with several conditions can add "and" to the statement or use an "either/or" clause. The Rule is configured with pieces of input data that the end-user input values are mapped to, then compared against the logic. An example Statement Rule might be, "if [email] exists, then true", where an end-user would enter their email for evaluation.
The Statement Rule produces two outcome paths in the Flow by default, True and False. Flow steps can be added to either path so that the data is worked by specific steps after it is evaluated by the Rule.
In this example, a conditional statement Rule will evaluate the account properties Email and Age. If the Email is not null and Age is greater than 25, the rule will return true. Otherwise, the rule returns false.
- Navigate to a Designer Folder and click CREATE RULE.
- Select Default under Statment Rule and click CREATE. Name the Rule and click CREATE to open the Rule Designer.
- Next, define the input data type for the rule. Click SETUP INPUT DATA.
- In the Data Definitions dialog, enter "Email" in the Name input field, then in the Type drop-down menu select String. On the next line add "Age" and choose Int32 as the Type. Then, click CLOSE to save.
- Choose Select Data Element, select Email [String], and click NEXT.
- Select Is Empty under Text Rules category and select the Not [this condition returns the opposite result] checkbox. This condition states that the username is not empty. Then, click DONE.
- Select ADD NEW RULE STEP. select Age and click NEXT.
- Expand the Number Rules category, select Greater Than, and click NEXT.
- Enter "25" in the Value field and click DONE.
- Click Save on the top action bar to save changes to the Rule.
- On the top action bar, click Debug.
- Enter "25" in the Age field and "email@example.com" for the email field. Then, click Run Capturing All.The Rule runs and evaluates the first condition as true and the second condition as false. This makes the entire Rule have a false outcome.