Creating your First Rule
- Updated on 24 Sep 2019
- 1 minute to read
A Rule evaluates input data to determine whether the data matches certain conditions. The rule returns the outcome, then it can pass this information to a flow, form, or report. This outcome may direct which path a flow follows, determine which controls display on a form, or how certain values in a report are formatted.
In the example, create a simple conditional rule that evaluates 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.
To create the rule, navigate to a Designer Folder and click the Create Rule button. Select Create Rule.
Name the rule and select Create to open it in the Rule Designer.
Next, define the input data type for the rule. The rule will accept two types of data: Email (string) and Age (int32). First, build the Email input type.
In the Rule Designer, select Setup Input Data.
In the resulting dialog, enter a name for the "Email" input, then in the Type drop-down menu, select String. On the next line add "Age" and choose Int32 as the Type.
Select Close to save and close.
Now that the rules input data is defined, it's time to build the rule.
First, build the condition that the user name value is not null. Choose Select Data Element pick Email [String] and select Next.
Expand the Text Rules category, select Is Empty and click the Not checkbox. This condition says that the username is not empty. Select Done.
To add another condition select Add New Rule Step.
Choose Select Data Element pick Age and select Next.
Expand the Number Rules category, select Greater Than, and click Next.
Since this comparison requires another value, choose Constant from the Mapping type drop-down list, and enter "25" in the Value field. Click Done.
The rule is complete. To test the rule, select Debug.
The rule needs data to validate so enter an appropriate age and user name in the Default Input section and select Run Capturing All.
The rule runs and the outcome displays. The first condition evaluates as true while the second evaluates as false, making the entire rule have a false outcome.