Introduction
When building apps in PowerApps, you often work with controls that allow users to select or enter data, such as Dropdowns, ComboBoxes, and ListBoxes. Two properties Default and DefaultSelectedItems are crucial for controlling what the user sees initially.
1. Default
The Default property specifies the value that a control initially displays when the app loads. It applies to controls that accept a single value, such as Text Input, Dropdown, Radio Button, or Toggle controls.
Key Points:
Works with single-select controls.
Can reference static values or dynamic data sources.
Ensures consistency in forms, pre-filling known or recommended values.
Example Usage:
Suppose you have a Dropdown for selecting a country:
Dropdown1.Items = ["USA", "Canada", "India"]
Dropdown1.Default = "Canada"
Dynamic Default:
You can also use a formula to dynamically set the default based on context:
Dropdown1.Default = If(User().Email = "[email protected]", "USA", "India")
This sets USA for the admin user and Mexico for everyone else.
2. DefaultSelectedItems
The DefaultSelectedItems property is used primarily for multi-select controls, like ComboBoxes and ListBoxes. It determines which items are initially selected when the app or form loads.
Key Points:
Can handle single or multiple values.
Must reference records or table data matching the items in the control.
Critical for forms that edit existing data from a data source like SharePoint, Dataverse, or SQL.
Example Usage:
Suppose you have a ComboBox for selecting multiple programming languages:
ComboBox1.Items = ["PowerApps", "Python", "JavaScript", "C#"]
ComboBox1.DefaultSelectedItems = ["Python", "JavaScript"]
Dynamic Example with Data Source:
Imagine a SharePoint list storing user roles:
ComboBoxRoles.Items = Choices(UserRoles.Role)
ComboBoxRoles.DefaultSelectedItems = Filter(UserRoles, UserEmail = User().Email)
3. Key Differences
| Property | Single-select | Multi-select | Type of Value |
|---|
| Default | ✅ Yes | ❌ No | Single value (text, number, Boolean) |
| DefaultSelectedItems | ❌ No | ✅ Yes | Table/record that matches Items source |
4. Common Scenarios
Pre-fill a user’s department:
Load saved selections in an edit form:
Conditional defaults:
Formula: If(Today() > Date(2026,2,18), "Expired", "Active")
Useful for dynamic forms or dashboards.
5. Tips and Best Practices
Always ensure DefaultSelectedItems references actual items in the control’s Items property; otherwise, the default will not appear.
Use LookUp to match complex records for DefaultSelectedItems.
For forms connected to data sources, always use ThisItem.FieldName to maintain consistency between EditForm and NewForm modes.
Combine If and User() for dynamic personalization.
Conclusion
Understanding Default and DefaultSelectedItems is essential for creating user-friendly, dynamic, and data-driven PowerApps applications. By setting these properties correctly, you can:
Mastering these properties ensures your apps feel intelligent and context-aware.