cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AKing
Regular Visitor

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

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
CarlosFigueira
Power Apps
Power Apps

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)

 

This gives me the error:

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

 

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

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

View solution in original post

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
Regular Visitor

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,401)