Conditional dictionaries

The availability of functionality depends on the license and may not be available in all deployments.

Conditional dictionaries are an optional variant of regular dictionaries. Using data passed to the dictionary, it is possible to write JavaScript conditions that will decide the visibility of selected dictionary values. For example, a subset of cities from the city dictionary based on a specified province.

Dictionary definition

The conditional dictionary definition window, in addition to standard elements, will have the section filled in Visibility conditions, Input parameters and keys and values linked by display conditions.

Condition definitions

We add conditions in the side panel Visibility conditionswhich will slide out after clicking the button in the left bar .

Each row represents one condition, the index allows linking the condition to dictionary keys and values. The condition should be described by a JavaScript expression using input data from the mapping.

Illustration 1. Example conditions defined for the dictionary

Input field mapping

In the Input parameterswhich will slide out after clicking the button in the left bar we can specify input data for the dictionary. The column Variable means the name of the variable that we will be able to use in JavaScript expressions when defining conditions, and Alias means the name of the variable visible when attaching the dictionary as a data source.

Illustration 2. Panel with example input parameters

Mapping conditions to keys

Each condition defined earlier has its reflection in the keys and values table as a column, according to the assigned index. Checking the checkbox at the intersection of the row with a key and the column with a condition means that the value will be visible when the condition evaluates to true.

Illustration 3. Example dictionary rows with mapped conditions

Evaluation of conditions

Conditions are evaluated in the order resulting from the index (which corresponds to: from left to right in the keys table), where the first condition that evaluates to true determines the set of displayed values.

Using a conditional dictionary

We attach the conditional dictionary in the same way as a regular dictionary (instruction: Connecting a dictionary data source). The only difference is that you must also specify the mappings of input parameters to components:

Illustration 4. Example of mapping dictionary input fields to form components

Demo forms: demoSlownikiWarunkowe, demoCombobox

Last updated

Was this helpful?