cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AKing
Level: Powered On

Combobox reset isn't working in runtime

I'm using a combobox to filter records in a gallery. I want to be able to unselect all items in the combobox by using the Reset with the DefaultSelectedItems left blank. I want this combobox reset to happen whenever the "Show all records" button is pressed or when the Back button is pressed. The different options I've tried work in preview while I'm editing the app on the web but they do not work when the app is running normally. Here are a couple of the options I've tried.

 

1. Toggle a variable to reset the combobox.

ComboBox.Default = 

ComboBox.Reset = reset_v

Button.OnSelect = UpdateContext({reset_v:true}); UpdateContext({reset_v:false})

2. Use the reset function.

ComboBox.Default = 

Button.OnSelect = Reset(ComboBox)

 

I used this document for reference.

 

https://docs.microsoft.com/en-us/powerapps/functions/function-reset

 

Is there something that I'm missing in order to get this to work?

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Combobox reset isn't working in runtime

Sorry, it should have been DefaultSelectedItems, not Default, as I had before:

ComboBox1.DefaultSelectedItems: []
Button.OnSelect: Reset(ComboBox1)

View solution in original post

5 REPLIES 5
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Combobox reset isn't working in runtime

Instead of setting the DefaultSelectedItems to blank (nothing), try setting it to an empty collection ([]) - that should work:

ComboBox1.Default: []
Button.OnSelect: Reset(ComboBox1)

(correction: it should be DefaultSelectedItems instead of Default for the Combobox):

ComboBox1.DefaultSelectedItems: []
Button.OnSelect: Reset(ComboBox1)

 

AKing
Level: Powered On

Re: Combobox reset isn't working in runtime

This gives me the error:

"The property expects Record Values, but this rule produces incompatible Table values."

 

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Combobox reset isn't working in runtime

Sorry, it should have been DefaultSelectedItems, not Default, as I had before:

ComboBox1.DefaultSelectedItems: []
Button.OnSelect: Reset(ComboBox1)

View solution in original post

AKing
Level: Powered On

Re: Combobox reset isn't working in runtime

Ok, that get's rid of the error. I tested my app with that change and the reset still doesn't work. I'm thinking that my app isn't publishing properly, so I did a couple of tests real quick.

 

First, I tried to add a new default style combobox with the default items list and a new button just to reset that combobox. This worked in preview but not when running the app. Second, I created a new app that contained only a combobox and a reset button. This worked in both preview and when running the app. In the new app the reset works when the DefaultSelectedItems is left blank or set to []. 

 

Are there limits in powerapps that I should know about to make it run smoothly or is this app somehow corrupted?

AKing
Level: Powered On

Re: Combobox reset isn't working in runtime

Through trial and error I found that after I ungrouped those items the reset function started working. I had about 30 items in the group but had only recently added 10 of those. With a smaller group there was no issue with resetting the comboboxes.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (3,729)