This article demonstrates how to set a default selection for a form element.
These instructions apply to the following elements:
- Drop down
For statically-defined data, simply choose a value in the Default Selected Value dropdown:
Data source-defined data
When an element is connected to a data source, you must modify its JSON definition to configure a default selection.
Although this example uses a static data source, the instructions also apply to task and PowerShell data sources.
The "Selected" Property
You specify a default selection by adding a Boolean
selected property to the data source's JSON definition.
For example, using the default data in a static data source, set the Porsche Boxter to
true, and the other two cars to
Next, set the Value and Text fields to
model, respectively. Then, enable the Default Selection property, and update the Selection Property to
Select the Update Field button, and then the Switch to editor button to preview the result:
If multiple items have a
selected property, the first one will be used.
Unlike the drop down, grid, and radio elements, the multiselect element can display multiple