I’ve researched in detail how to use the Modern Combobox (ComboboxCanvas) in Power Apps, and here are my findings.
Modern Combobox (ComboboxCanvas)
The Modern Combobox (ComboboxCanvas) is one of the modern controls available in Power Apps canvas applications. It’s a control designed to provide users with selection options.
As shown in the image, the top control is the modern version, while the bottom one is classic. You can see how the modern version has a much cleaner and streamlined appearance.
In this article, I’ll dive deep into the features and functionality of this Modern Combobox.
Basic Usage
The basic functionality is almost identical to the previous (classic) combobox.
Single Selection
Let’s first look at how to use it as a single-selection combobox. To set it up, configure the Items property with an array or table containing the selection options that will be presented to users.
In single-selection mode, you can access the user’s selected value through the Selected property.
Multiple Selection
You can enable multiple selection by setting the SelectMultiple property to true.
Just like with single selection, you set up the options by configuring the Items property with an array or table.
The key difference from single selection is that when accessing the Selected property, you can only retrieve the last item the user selected, not all selected items.
Therefore, when multiple selection is enabled, use the SelectedItems property to access all user-selected values. Note: Since the SelectedItems property returns a table, you’ll need to use the Concat function to display it as text.
One of the main applications for multiple selection is when working with delegable data sources that support the ‘in’ operator, such as Dataverse.
This is particularly useful when you need to filter data using the Filter function to match selected items.
For more information about the “in” operator, please refer to:
Power Apps 'in' Operator: Complete Guide from Basics to Advanced Usage (Including 'exactin' & Delegation)
Here's a detailed exploration of the "in" operator in Power Apps, which I recently researched thoroughly.The "in" Operat...
Setting Default Selection
When you want to set a default selection in the combobox, use the DefaultSelectedItems property. Note: Since it’s “Items” (plural), you must specify it as an array.
Enabling Search
Set the IsSearchable property to true to enable searching through the options.
The search feature is commonly used with the Office 365 Users connector. When you enable search and configure the Items property with the Office 365 Users connector as shown in the image,
you can filter the results using the search functionality.
Additionally, you can access the entered search text through the SearchText property.
For more information about handling Office 365 Users, please refer to:
Power Apps How to list Office365 Users Connector in a combobox and how to set default values
Note that I was asked how to display a list of Office365 Users Connector in a combo box and set a default value.Office 3...
The main difference from the classic is the design.
The main differences from the classic combo box are the “TriggerOutput” and “design”.
TriggerOutput
Like the Modern Text Input control, the Combobox also allows you to select TriggerOutput settings:
- FocusOut: Triggers when focus leaves the ComboboxCanvas
- Delayed: Triggers 1/2 second after the user stops typing
- Keypress: Triggers immediately with each user input
When set to Delayed or FocusOut, there will be a slight delay before the search box input is reflected in the SearchText property.
Note that TriggerOutput primarily affects the “search text (SearchText)” property, while selection states are updated instantly when an item is selected.
Appearance
The Appearance property offers three options, each with its distinct visual style as shown below:
Additionally, the modern version supports BorderRadius adjustment, allowing you to create rounded corners.
ValidationState
Similar to the Modern Text Input, setting the ValidationState property to “Error” will turn the border red. Note: This is visible when the border width is 1 or greater.
For more information about Modern Text Input, please refer to:
How to Use Power Apps Modern Text Input (TextCanvas): A Comprehensive Guide to Modern Controls
The Power Apps modern control Text Input (TextCanvas) has been updated. Let's explore its features and usage in detail.M...
Tip 1: When Options Don’t Display Despite Setting Items
For example, when you set an array to the Items property,
The options might disappear when you modify the Items property.
This occurs because the [Fields] in the modern combobox don’t update automatically. To fix this, remove the old fields from the [Edit] menu,
Then select the correct fields through [Add fields], and the options will become visible again.
Tip 2: Maximum Item Limit
When you try to load 1,200 items into a Modern Combobox using the Sequence function,
Only 800 items will be displayed. This appears to be a hard limit of 800 items for the Modern Combobox, regardless of delegation or data row limitations since this isn’t connected to a data source. Note: For comparison, Gallery controls can display up to 1,200 items.
Furthermore, even when using the search function, items beyond 800 cannot be accessed, suggesting that excess items are truncated from the beginning.
コメント