Writing Conditional Rules with Expression Builder
Use this procedures to write conditional rules with Expression Builder.
The Expression Builder allows you to write rules against the data on a form and against user information. In addition, you can use many delivered functions in the expressions that help you access user and form information, and enable you to transform or manipulate data as well (such as combine two strings together).
The Expression Builder consists of three panes—top, middle, and bottom.
-
The top part shows the complete expression as it is displayed and also is where you set the access level for the conditions in the expression.
-
The left part of the middle pane lists the categories of several types of items you can insert into an expression, and the right part of the middle pane contains individual items for one category. You can click on items displayed in the right side of the middle pane in order to insert them into the expression.
-
The bottom pane is where the expression is built. It also contains buttons that you can click to insert operators and values in the expression, or that you can click to help edit the expression (such as an Undo button and a Paste button).
To write conditional rules using the Expression Builder
- Make sure that the security class that the online form rule belongs to also grants access to the system code (category) and program that contain the online form. If the security does not grant access to these objects, select these objects and create rules granting access.
- In the Object Selector, select the online form you want to write a rule for.
- On the Rules form, select Conditional Rule Access.
- From the drop-down list for conditional rule types, select If Then Else.
- Click the Edit button.
- In the Expression Builder, build an expression by typing or inserting items into the bottom pane. To start the process, click the pencil icon in the top pane. To insert items, either click on the items at the top of the bottom pane, or expand the hierarchy in the left side of the middle pane, click the item category you need, and then click on the specific item in the right side of the middle pane to insert the item in the expression. If you type the expression directly, you can also use an auto-completion feature by typing the name of an object type, a period, and then pressing Ctrl+Space. For example, if you type “form.” and then press Ctrl+Space, a list of a form's fields is displayed. You can double-click one in order to insert it in the expression.
- Optional. When you have completed the expression, click Verify Expression. The status bar will indicate whether the syntax is correct.
- Click Store when you have finished creating a conditional expression.
- Optional. If you need to create another conditional expression, click the plus sign in the top pane and then the pencil icon next to the ELSEIF box.
- When you have finished creating conditional expressions, click the square next to the “Then” and “Else” boxes and select the appropriate access level. Your choices are ALL_ACCESS, NO_ACCESS, and the individual form actions available for the form.
- When you have finished writing the rule and setting the access level for each expression, click Finish on the Expression Builder form and then click Apply on the Rules Builder form.