Skip to main content
Version: 2027 R1

Choice field

The Choice field attribute allows the user to select one or more values from a list backed by a data source. The field can operate in one of three modes – a drop-down, a popup search window, or an autocomplete text field – which directly affects the configuration options described below.

info

For more information on the Choice field attribute visit the following WEBCON Community websites:

Properties​

Properties section of the Choice field configuration (Dropdown mode) with numbered groups

1. Choice field type​

Three buttons let you select the operating mode of the field:

  • Dropdown – selection of one value from a drop-down menu,
  • Popup search window – displays a pop-up window that allows searching for and selecting values,
  • Autocomplete – a text field which dynamically suggests answers depending on the entered characters.

Selecting Popup search window or Autocomplete unlocks additional option groups – they are described in the following sections of this page.

2. Data sources​

  • Data source – lets you specify the source of the values used by the field. It is possible to overwrite the query which was configured in the data source.
  • Use additional filters – a switch that reveals a field where you can define a rule that further narrows the values returned by the data source. Press Ctrl+Space for suggestions, or type @ to search for objects.
  • Override data source sort – a switch that lets you replace the sorting configured in the data source. Add consecutive sort levels to the table with the Add button, specifying the Column name and Sort type for each. For a detailed description of the option, see the Person or group form field.
  • Test – opens the Test window, where you can check the results returned by the data source with the current configuration.

The Use additional filters, Override data source sort, and Test options are available once a data source is selected, regardless of the selected choice field type.

info

To access further configuration of the attribute, it is necessary to select a data source first.

3. Appearance and behavior​

  • Columns – a list of columns used by the field. The Type column shows the role of each row: the ID row corresponds to the column whose value is stored as the identifier of the selected value – the source column should contain unique values. The Name row represents the column whose value will be displayed in the field after selecting a value. In the Display text column, you can rename the column and add its translations. Add further columns with the Add column button.
  • Sort values by display name – selecting this option sorts the values in the drop-down list alphabetically by their display name.
  • Include selected values that do not exist in the data source – checking this option causes values previously saved in the database to be added to the list, even if they were removed from the data source. This is useful when records have been removed from the data source – instances saved in the database will keep their archival value, while new instances will only allow selecting current values present in the data source.
  • Query data source if variables return empty values – lets you define whether the system allows the use of tags with empty values. Once checked, a query containing tags with empty values will not return any results.
  • Support multi language names – enables translations based on the language set in the user's Portal profile. For translations to display correctly, the data source linked to the field must be properly prepared – either using a predefined data format (DEFAULT_NAME$$LANG_CODE$$LANG_NAME$$LANG_CODE$$LANG_NAME) or additional translation columns selected via the language icon.
  • Display empty element – turning this switch on reveals the Empty element display name field, i.e. the name displayed in the drop-down list to indicate that no value has been selected in the choice field yet (e.g. "---Select---"). When a user selects such an item, the system treats it as a non-selection – if the field is set as required, it will not be possible to proceed to the next step.
info

Additional information about multilingual choice fields can be found in the article available on the WEBCON Community website.

Additional options for Popup search window mode​

Once Popup search window is selected, the Appearance and behavior group gains extra columns in the table (Target field, Searching, Show in search results) and two extra options – Validate the typed values in the data source and Allow multiple values (the Sort values by display name, Include selected values that do not exist in the data source, and Display empty element options are only available in Dropdown mode) – and three new groups appear below it, described below.

Additional property groups available in Popup search window mode

1. Allow adding values not in data source​

This option allows the user to select a value that is not present in the data source – a button is added on the form that lets the user enter their own value. Such a value is saved in the database as "-GUID#entered_name". Enabling this option reveals additional fields:

  • Allow editing target fields when new value is added – enables editing of the fields set by the choice field, which are displayed in read-only mode. When switching back to selecting a value from the data source, these fields are switched back to read-only mode.
  • Javascript executed on change of choose value mode – a script executed when the user uses the button for adding a value from outside the data source.

2. Allow adding values to the data source​

  • Link to a form for adding values to the data source – lets you insert a link to a form that allows manually adding extra entries to the data source, e.g. a dictionary process form. The link is then displayed in the choice field under the label Add new.

The "Add new" link shown in the choice field after configuring a link to a form for adding values to the data source

3. Search mode​

Determines how the entered phrase is searched for. Three modes are available: Starts with (default), Contains, and Exact match.

Additional options for Autocomplete mode​

Autocomplete mode exposes the same option groups as Popup search window mode described above (in the Columns table, the Show in search results column is labeled Show in selection list instead), plus one additional group:

Additional property group available in Autocomplete mode

1. Autocomplete​

  • Number of characters to activate search – the number of characters that must be entered before suggestions start appearing (default 3).
  • Number of results in first search – the number of results shown after the required number of characters has first been entered (default 5).
  • Maximum number of results in search – the maximum number of results shown in the suggestion list (default 100).

Examples​

Choice field – a drop-down

Choice field – a drop-down

Choice field – a popup search window

Choice field – a popup search window

Choice field – autocomplete

Choice field – autocomplete