Keywords that can be used between BEGINGROUP…ENDGROUP

There is a number of optional elements that can be included between the keywords BEGINGROUP and ENDGROUP.

You can use the following keywords after the keyword BEGINGROUP.

EXPANDABLE keyword

Use EXPANDABLE to show or hide a group. EXPANDABLE cannot be used in combination with SHOW or SHOWNOT in a single group.

EXPANDED keyword

EXPANDED TRUE|FALSE

The keyword EXPANDED is followed by a value type BOOL. This value decides whether a group is expanded or collapsed. The value is calculated once KCM ComposerUI for HTML5 questions screen is loaded. By default, a group is expanded.

HIDECONDITION keyword

HIDECONDITION TRUE|FALSE

The keyword HIDECONDITION is followed by a value type BOOL. This value decides whether a group is visible or invisible for the user. The value is calculated once KCM ComposerUI for HTML5 questions screen is loaded. If the value yields TRUE, the group is not shown and all questions are assigned the DFT value. If no DFT answer has been provided, a variable or an ARRAY element is assigned an empty value (in case of a TEXT), zero (in case of a NUMBER), or FALSE (in case of a BOOL). By default, a group is visible.

SHOW keyword

You can use the keyword SHOW to show a group dynamically, depending on the answer given to a question that precedes the group. The keyword SHOWNOT is used to hide a group dynamically. The question needs to have an ID that the keywords SHOW or SHOWNOT can refer to. When using the keyword SHOW, the group is shown when the value of the question that has an ID satisfies the condition.

When the group is currently visible and the user changes the answer to something that does not satisfy the condition, the group turns hidden. When using the keyword SHOWNOT, the behavior is reversed.

SHOW ID("id of the question")
SHOW ID("id of the question") = value
SHOW ID("id of the question") </<=/>=/> value
SHOW ID("id of the question") CONTAINS value
SHOW ID("id of the question") IN value
SHOWNOT ID("id of the question")
SHOWNOT ID("id of the question") = value
SHOWNOT ID("id of the question") </<=/>=/> value
SHOWNOT ID("id of the question") CONTAINS value
SHOWNOT ID("id of the question") IN value

SHOW and SHOWNOT cannot be used together in the same group.

The following expressions are currently supported:

  • ID ("id") requires that the question with ID ("id") is a BOOL question. The group is shown if the answer to the question is TRUE.
  • ID ("id") = value requires that the question with ID ("id") is either a TEXT or NUMBER question. The group is shown if the answer to the question is equal to the value.

  • ID ("id") </<=/>=/> value requires that the question with ID ("id") is a NUMBER question. The group is shown if the answer to the question is respectively smaller (<), smaller or equal (<=), greater or equal (>=), or greater (>) than the specified value.

  • ID ("id") CONTAINS value requires that the question with ID ("id") is a MULTISELECT TEXT question. The group is shown if the answer to the question contains the value of one of the selected items.

  • ID ("id") IN value requires that the question with ID ("id") is a TEXT question and the value must be an ARRAY TEXT variable. The group is shown if the answer to the question is present in the array.

The same expressions are supported for the keyword SHOWNOT, but the groups are hidden when the condition is met.

The keywords DATE and TIME are supported for NUMBER answers when performing a test.

The result of an expression can be negated using the NOT operator.

SHOWNOT keyword

SHOWNOT ID("id of the question") = "test"

Multiple expressions can be combined using the logical operators AND and OR. The result of an expression can be negated using the NOT operators. Enclose expressions in brackets to disambiguate the use of AND and OR.

SHOW ( (ID("id question 1") = 4) AND NOT (ID("id question 2") = "test") ) OR (ID("id question 1") = 42)

Note the following limitations when using the keywords listed in this section:

  • The ID keyword cannot reference questions that specify the keywords EDITABLE_TEXTBLOCK or VIEW.
  • The SHOW and SHOWNOT keywords cannot be used in a group marked EXPANDABLE.
  • The CONTAINS keyword cannot be used on an ordered MULTISELECT question, such as a question that has both the keywords MULTISELECT and ORDER.
  • The FILE question cannot be used on SHOW and SHOWNOT conditions.