Creating your First Rule
  • Updated on 12 Jun 2013
  • 2 minutes to read
  • Print
  • Dark
    Light

Creating your First Rule

  • Print
  • Dark
    Light

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 a 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.
Rules are built in the Rule Designer . Navigate to a Designer Folder, click the Create Rule button, and select Create Rule .

Example

In the example, create a simple conditional rule that evaluates the account properties Username and Age . If the Username is not null, and Age is greater than 25, the rule will return true . Otherwise the rule returns false . The example assumes a Designer Folder already exists.
To create the rule, navigate to a Designer Folder and click the Create Rule button. Select Create Rule .

2017-12-18_173307.png

Name the rule and click 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: Username (string) and Age (integer).
First, build the Username input type.
In the Start Rule window, in the Rule Input Data section, click the Add New button.
2017-12-18_173952-1024x349.png

In the resulting popup, enter a name for the Username input, then click the Type selector. Select String.
Back in the Edit object popup, click Save to save the input type.
Repeat the process by adding an input type for Age . In the Start Rule window, in the Rule Input Data section, click the Add button.
In the resulting pop-up, we enter a name for the Age input, then click the Type selector. Select Int32 , and click OK .
2017-12-18_174257.png

Now that we've defined our rule's input data, it's time to build the rule. In the Start Rule window click Add New Rule Step button.
2017-12-18_175120-1024x146.png

First, build the condition that the user name value is not null. Select User Name [String] and click Next .

2017-12-18_175130-1024x484.png

Expand the Text Rules category, selectIs Empty and click the Not checkbox. This condition says that the username is not empty. Click Done.
2017-12-19_142840-1024x386.png

Next, build the rule that the age is greater than 25.

Select Age and click 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 .
2017-12-19_142850.png

The rule is complete. Click on Save Rule . To test the rule, click on Debug Rule .

2017-12-19_143327.png

The rule needs data to validate so enter an appropriate age and user name in the Flow Input Data pop-up and click Run.

2017-12-19_143507-1024x723.png

The rule runs and the outcome displays.

2017-12-19_143609-1024x723.png

Was this article helpful?