Option Selection Fields
Last updated
Last updated
As we saw earlier, there are certain components that, due to their functionality, have a series of specific properties for their type. This is the case for fields that allow predefined options: Options, Boolean, and Tristate.
The Options tool allows you to generate a list of predefined values from which the user will make a selection. Let’s analyze its functionality by including a field of this type in the "Address" section. Next to the "Province or department" field, place a new required field named "country," define its Label as "Country," and reduce its size to 2 units. Don’t forget to save your changes as you progress in designing your form.
Within the Properties section, go to the Options subsection and click the "+" button next to the Value description. A new value, "Option 1," will be added. You can repeat this step as many times as needed; in this case, we will add three options: Argentina, Paraguay, and Uruguay. If you want to delete an option, click the trash icon that appears to its right.
You can choose different display variants from the Properties > Appearance section. The main ones are:
Select: Displays the options in a dropdown list.
Options: Displays all options on the screen in a radio button format.
It is recommended that when choosing the format that best suits your form, you enable real-time preview and check its functionality.
The Split Value/Label option allows you to assign each option a real value different from what is displayed to the user. This helps simplify data processing. For example, if each country had an assigned internal code, we would display the country names in Label and input the corresponding code for each in Value.
Unlike Options, the Boolean field allows you to set a binary logic value (yes/no) where the user can define whether a condition is true or not by toggling the button on or off. This field retains the general properties common to input fields, and the value to be evaluated is defined in the Label property.
This type of tool can be used to report a status, mark compliance with certain characteristics, decide on the preference for an additional service, etc. Within Appearance, you can choose between the Switch variant, which will display a slider like the example, and the Checkbox variant, which will display a checkbox.
Fields of this type generate a button with three possible states: true, false, and null (no response). Due to its simplicity, the configuration options for Tristate are limited to general properties similar to those of Boolean. However, it differs from this field by allowing a neutral response without requiring the user to choose a predefined positive or negative value.