Select
This page provides information on the Select widget (formerly known as dropdown), that enable users to select a single option from a given list.
Content properties
These properties are customizable options present in the property pane of the widget, allowing users to modify the widget according to their preferences.
Data
Source Data array<object>
Specify data as an array of objects to display options in the widget. For example:
[
{
name: "Blue",
code: "BLUE",
},
{
name: "Green",
code: "GREEN",
},
{
name: "Red",
code: "RED",
},
];
You can dynamically generate options by fetching data from queries or JS functions and binding the response to the Source Data property. For example, if you have a query named fetchData
, you can bind its response using:
{{fetchData.data}}
If the retrieved data is not in the desired format, you can use JavaScript to transform the data by adding it to the Source Data property, like:
{{fetchData.data.map( p => ({label: p.country, value: p.country}))}}
If you are generating options for Select widget using JS code as shown above, make sure to define both the Label and Value properties.
Label
The Label property is a group of customizable settings that define the main text displayed on the widget. key string
Defines the key in the Source Data that specifies the labels for each option in the Select widget. When using the JS mode for dynamic configurations, the value must evaluate to a valid property name present in each object of the data array. Data cannot be manipulated directly (for example, applying .toLowerCase()
or .toUpperCase()
).
Example: If your API provides multilingual data like:
{
"name": "Red",
"nameHindi": "