Add a Display Rule action
Use a Display Rule to dynamically control what is displayed on a form or how the controls on the form behave. For example, you can hide one or more fields on the form, make a field read-only or disabled, and more. At runtime, the Display Rule is invoked once the user clicks the configured control with the defined action.
You can configure a control's display properties to change automatically in real time, based on what the user enters into the form. For example, when filling in an online Insurance form, if the required job title is not available in the Occupation list, the user can select the Other option, which would display an additional field to enter the job title. However, if the user selects an occupation from the predefined list of job titles, the additional text box does not appear.
What is a Display Rule?
A set of conditions defined for one or more fields and display states enforced when the conditions are met or not met.
A display rule consists of the following four main elements.
| Element | Description |
|---|---|
| Field | A field on the form, form variable, or
global variable.
Use the following controls in a condition to trigger a display rule:
Note The Button, Toolbar, Table, Image Button, Hyperlink, Tab
and Horizontal Rule controls cannot be used in a condition, as they do not
expose any properties for use within a condition.
|
| Operator |
|
| Value | A static or a dynamic value. You can use a form field, form variable, or global variable as a dynamic value. |
| Display States | Based on a true or false condition and the
control used, the display states can change to one of the following:
|
- On the Form Modeling bar, click Actions.
-
On the
Actions page, click
Add
.
- On the Type list, select Display Rule.
- Enter a Name and Description for the action.
- Optionally, configure a unique action for each language separately. See Configure multilingual actions for a form or control for more information.
-
In the
Rule box, enter the rule
to invoke upon clicking the control.
Note the following:
-
You can use static values, dynamic values, or a combination of both-static and dynamic values-in your display rule.
-
You can reuse the display rule by copying and pasting it in another display rule.
-
-
Under
True Outcome, set the
display state to enforce when the condition is met:
-
Consume the required field or cell in the
Name box.
Note You can also use table columns in the outcome.
- On the Display list, select the required display state.
-
Click
Add
.
Note You can define the same display setting for multiple fields.
-
Consume the required field or cell in the
Name box.
-
Under
False Outcome, set the
display state to enforce when the condition is not met.
The order of execution of rules depends on the order in which they are consumed in an event. For example, consume the following two display rules as follows:
Display Rule 1, where Field1 = 10 and Field2 = Mandatory.
Display Rule 2, where Field1 > 5 and Field2 = Optional.
The last rule is applied. Therefore, Field 2 is set as optional.
-
Click
OK.
The newly created action is added to the table.
- Click Save.
-
Associate the action with the control to trigger this action. To
call the Display Rule action upon form load, associate the action with the
form. See
Associate an action with a form or
control.
Follow the given rules while creating a display rule action, otherwise warning messages appear:
-
The value of the field must be valid. For example, the value for a String data type field must be a piece of text, or the value of Numeric data type field must be in numbers.
-
You may have no conditions set for a rule, but set at least one display state within a rule.
- Specify at least one outcome (true or false); all outcome fields must be complete.
-