Introduction

The Modern Combo Box control in Power Apps offers a cleaner user interface, improved accessibility, and smoother performance through virtualization. However, when working with large data sources, many developers encounter an unexpected limitation:

This behavior is common and directly related to how the modern control handles data.

The Problem: DefaultSelectedItems and Large Data Sources

When the modern Combo Box is connected to large data sources such as:

You may experience issues including:

The same configuration typically works without issues when using the classic Combo Box.

Why This Happens

The modern Combo Box uses virtualization to improve performance.

Key behavior:

As a result:

The Solution: Merge the Selected Record into the Items Collection

Because loading the full dataset is not practical, the solution is to ensure that the selected record is explicitly included in the data rendered by the Combo Box.

Once the selected record is part of the Items collection, the control can resolve it correctly regardless of its original position in the data source.

Step-by-Step Implementation

Step 1: Store the Selected Record

Set(
    varSelectedUser,
    LookUp(DataSource, ID = ThisRecordID)
);

Step 2: Merge the Selected Record into the Items Property

With(
    {
        wSelected: If(
            !IsBlank(varSelectedUser),
            Table(varSelectedUser),
            Blank()
        )
    },
    Ungroup(
        Table(
            { Data: Office365Users.SearchUserV2({ searchTerm: "" }) },
            { Data: wSelected }
        ),
        "Data"
    )
)

This approach:

Step 3: Configure DefaultSelectedItems

DefaultSelectedItems: Table(varSelectedUser)

Results and Benefits

This pattern provides the following benefits:

Final Notes

The modern Combo Box control improves performance through virtualization, but its limited in-memory record window can cause issues with default selections when using large datasets.

By merging the selected record into the dataset rendered by the control, you ensure consistent and reliable behavior for DefaultSelectedItems regardless of data size.