Display rule action

Use a Display rule action 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 the form. For example, when filling out 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 display rule is 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:

  • Label

  • Textbox

  • Dropdown

  • Radio button list

  • Checkbox

  • Calendar

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
  • Less Than "<"

  • Greater Than ">"

  • Equals "="

  • Not Equal "< >"

    Example: Field1 = "£30,000"

Value A static or 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 be one of the following:
  • Read-only

  • Enabled

  • Disabled

  • Hidden

    You can also hide fields on the form using a Document or Activity variant. See Document / Activity variants.

  • Mandatory

  • Optional

  • Visible

Use logical operators ("AND" or "OR") to construct multi-field conditions. For example, Field1 = £50,000 AND Checkbox = Checked or Unchecked.

  1. On the form modeling bar, click Actions and click New.

    The New action dialog box is displayed.

  2. On the Type list, select Display rule.
  3. Change the default Name (DisplayRule1) to something meaningful.
  4. Optional. Enter a Description for the action.
  5. Optional. Select Multilingual to configure a unique action for each language separately. See Configure multilingual actions.
  6. Define the rule to invoke upon clicking the control.
    1. Right-click in the rule editor and select the variables.

      • 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.

    2. Click Validate.
  7. Under True outcome, set the display state to enforce when the condition is met:
    1. Click
    2. In the Name list, select the required control.
      You can also use table columns in the outcome.
    3. On the Display list, select the required display state.
    4. Click Add.

      You can define the same display setting for multiple fields.

  8. Under False outcome, set the display state to enforce when the condition is not met.
    1. Click
    2. In the Name list, select the required control.
    3. On the Display list, select the required display state.
    4. Click Add.
    The order of execution of rules depends on the order in which they are selected in an event. For example, define the following two display rules and set their order as follows:
    1. Display rule 1, where Field1 =10 and Field2 = Mandatory.
    2. Display rule 2, where Field 1>5 and Field2 = Optional

    As Display rule 2 is applied last, Field 2 is set as optional.

  9. Click Add.

    The newly created action is added to the actions list.

  10. Associate the action with the control to trigger this action. See Configure actions for form control events. Alternatively, to call this action for a form event, associate the action with the form. See Associate an action with a form.

    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 the 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.