Power Apps Combo Box OnChange

Are you familiar with the Power Apps Combo box OnChange property? If Not, follow this complete tutorial.

Power Apps Combo box OnChange property says how the application responds when a user changes the combo box selection value. In this Power Apps tutorial, I will explain “Power Apps Combo box OnChange.

Power Apps Combo Box OnChange

Let’s see how the application responds when users change the Power Apps combo box selected value.

Example 1:

I have a SharePoint Online list [User Details] that has various columns like:

Column NameData Type
User IDTitle
User Join DateDate and time
User Subscription TypeChoice [“Premium,” “Standard,” “Basic”]
User DeviceChoice [“Premium,” “Standard”, “Basic”]
Power Apps Combo Box OnChange

I created a Power Apps Canvas app and added an Edit form. The form contains the Combo box control connected to the above SharePoint list choice column [User Subscription Type]. The Power Apps combo box will display its default value as “Basic.”

When a user changes the selected value in the combo box to “Premium,” the text label will display as shown below:

Power Apps OnChange property of the Combo box

Follow the below-mentioned steps to achieve it:

1. Sign in to your Power Apps with your valid Microsoft 365 credentials.

2. Create a Blank canvas app -> On the Power Apps screen, insert an Edit form. Then, add a new data source for the above SharePoint list and set the Edit form’s Data source property.

Where,

  • User Details = Datasource name
How to use the Combo box OnChange property in Power Apps

3. Select the Combo box -> Set its OnChange property to:

Set(
    varSubscription,
    DataCardValue2.Selected.Value = "Premium"
)

Where,

  • varSubscription = Provide the variable name
  • DataCardValue2 = Combo box control name
  • Premium = Combo box value
Combo box OnChange property in Power Apps

4. The text label should display when a user changes the combo box selected value. For that, Select the User Subscription Type DataCard -> Insert the Text label -> Set its Text property as:

"20% Offer"
Power Apps combobox onchange issue

5. Select the Text label -> Set its Visiblity property to:

varSubscription 

Where,

  • varSubscription = Variable name
Power Apps Combo box multiselect OnChange

6. Once your app is ready, Save, Publish, and Preview the app. When a user changes the selected value in the combo box to “Premium,” the text label will display a “20% Offer”.

OnChange property of the Power Apps Combo box

This is how we can work with the Power Apps Combo box OnChange property.

Example 2,

I have a SharePoint Online list [Loan Approval] that has various columns like:

User NameTitle
Loan TypeChoice [“Home Loan,” “Car Loan,” “Gold Loan”]
Loan Application DateDate and time
Loan Handled ByPerson or group
How to work with Power Apps Combo box OnChange

I created a Power Apps Canvas app and added a Combo box and Gallery control. The combo box is connected to the SharePoint list person column [Loan Handled By].

When a user changes the values from the Combo box control, the gallery will filter and display the user name based on the selected combo box value, as shown below:

How to use a OnChange property of a Power Apps Combo box

To achieve it, follow the below steps:

1. On the Power Apps screen, insert a Combo box control -> Set its Items property to:

Distinct(
    'Loan Approval',
    'Loan Handled By'
)

Where,

  • Loan Approval = SharePoint list name
  • Loan Handled By = SharePoint list person column name
Combo box OnChange in Power Apps

2. Select the Combo box -> Set its OnChange property to:

Set(
    varLoanApproval,
    cmb_LoanHandledBy.Selected.Value
)

Where,

  • varLoanApproval = Provide the variable name
  • cmb_LoanHandledBy = Combo box control name
Use a OnChange property of a Combo box

3. The gallery will display when a user changes the combo box selected value. For that, insert a Gallery control -> Set its Items property to:

Filter(
    'Loan Approval',
    IsBlank(cmb_LoanHandledBy.SelectedItems.Value) || IsEmpty(cmb_LoanHandledBy.SelectedItems.Value) || 'Loan Handled By' = varLoanApproval
)

Where,

  • Loan Approval = SharePoint list name
  • Loan Handled By = SharePoint list person column name
  • varLoanApproval = Variable name
  • cmb_LoanHandledBy = Combo box control name
Power Apps Combo box OnChange is not working

4. Once your app is ready, Save, Publish, and Preview the app. When a user changes the selected value in the combo box, the gallery will display the user names based on the selected value.

Combo box multiselect OnChange in Power Apps

This was another method to display the gallery based on changing the combo box value by utilizing a combo box’s “OnChange property.”

Conclusion

In this Power Apps tutorial, I have explained the “Power Apps Combo OnChange” with two examples:

  • How does the text label control display when users change the selected value in the combo box?
  • How to display a gallery when a user changes the combo box selected value.

You may also like: