Conditional dictionaries

circle-info

Availability of the 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 decide the visibility of selected values from the dictionary. For example, a subset of cities from the city dictionary based on a selected province.

Dictionary definition

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

Condition definitions

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

Each row represents one condition; the index allows the condition to be linked to the keys and values of the dictionary. The condition should be described with a JavaScript expression using input data from the mapping.

Figure 1. Example conditions defined for the dictionary

Mapping input fields

In the Input parameters, which will slide out after clicking the button in the left bar , we can specify input data for the dictionary. 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.

Figure 2. Panel with example input parameters

Mapping conditions to keys

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

Figure 3. Example dictionary rows with mapped conditions

Condition evaluation

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

Using the conditional dictionary

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

Figure 4. Example of mapping dictionary input fields to form components
circle-info

Forms demo: demoSlownikiWarunkowe, demoCombobox

Last updated

Was this helpful?