Optional elements

Optional element containers provide other elements to optionally add/remove in a form.

Selected optional elements are aligned in the container one below the other and can be added or removed by clicking the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg /images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/forbidden.svg symbols.

Elements that do not qualify as 'filled' (because they do not contain data), do not appear when a form is loaded. In turn, an option that is added but not filled with data is not saved.

►NOTE◄ An optional elements container may provide more or less complex data (e.g. other container elements with multiple input elements) as options. Validation logic (required fields, validation rules) applies only for selected options. Therefore, optional containers are a good solution for the requirement that a user must provide valid data if an option is added, whereas these validation constraints are disregarded if the option is removed, as if the contained elements were inactive or inexistent.

IMPORTANT◄ Within a portal, a data field must not be specified directly for an Optional elements container, otherwise the data from the optional elements will not appear in the form data. To be able to combine the data of the optional elements in a parent data field, the Optional elements container must be placed in another Element containers that defines the data field in question.

Properties

The 'Optional elements' container features the following specific parameters as 'Properties':

images/download/attachments/189437389/image-2024-11-12_15-12-39-version-1-modificationdate-1731420759270-api-v2.png

The parameter Max. number of options defines an upper bound for the number of eligible options. A setting of '0' (default) is defined as 'unlimited' (see the tooltip on images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/help_16.svg ).

►IMPORTANT◄ The setting for Max. number of options is ignored when data is loaded and only limits the addition of new entries. It is not considered as a validation criterion.

As soon as the maximum number of options is reached, the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg symbol becomes ineffective. Besides, the context menu listing with available options (see below) will no longer appear.

Without the option Allow add/remove by user checked, both symbols images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg and images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/forbidden.svg will not appear in a form at runtime. This setting may be relevant, for example, to restrict adding and removing elements to the respective actions Add element (optional/repeatable element) and Remove element (optional/repeatable element). The status of this option may be controlled by the action Allow add/remove at runtime.

Tip: When configuring the form, elements can be added or removed directly via the icons images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg and images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/forbidden.svg by holding down the 'Shift' key.

Example

In the following example three company comboboxes are featured in an optional element container:

images/download/attachments/189437389/image-2024-11-12_15-26-51-version-1-modificationdate-1731421611156-api-v2.png

The input form shows the following behaviour:

At first, only the label for the optional elements container ('Optional parties ) is shown.

When the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg symbol is clicked, a context menu lists the three available options by their labels.

images/download/attachments/189437389/image2019-3-21_17-27-18-version-1-modificationdate-1731420511848-api-v2.png

In this example, the first choice 'Principal' is selected.

As a result, the combobox element Principal appears instead of the container label.

When images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg is clicked again, the context menu reappears with only the two remaining choices for companies:

images/download/attachments/189437389/image2019-3-21_17-32-38-version-1-modificationdate-1731420511845-api-v2.png

Next, 'Freight forwarder' is selected.

Now the company selection element for Freight forwarder is also displayed.

images/download/attachments/189437389/image2019-3-21_17-34-36-version-1-modificationdate-1731420511827-api-v2.png

Clicking the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/forbidden.svg symbol next to an added element removes the element.