cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hpkeong
Level 10

Combo Box Reset

Hi PG:

 

Just consider to migrate from DropDown to ComBox Box.

 

I have an issue here:

- I try Button.Pressed to Reset the selected items to "Fnd items" (that is before any item is selected), but it neve works.

- Even using Set to false and Set to true of context variable with Reset = Context Variable, also never work.

 

Any advice will be much appreciated.

 

Meantime, the tutorial is unclear of certain application, including:

- SelectedItems

 

Thanks and have a nice day.

hpkeong
1 ACCEPTED SOLUTION

Accepted Solutions
Raf
Level: Powered On

Re: Combo Box Reset

Hi Guilla,

 

using hpkeong solution,

if you have add button include this to your formula:  Set(myvar,[])

then set your combobox defaultselecteditems to: myvar

View solution in original post

15 REPLIES 15
hpkeong
Level 10

Re: Combo Box Reset

HI PG:

 

Try sharing my current workaround, which is definitely workable, but doesn't sound good.

 

Combox.DefaultSelectedItems = myvar (context variable),

Create a button or anything, to set or updatecontext:

= Set(myvar, ["Find items"])

... ["Any hint text"] to blank out the previously selected item and show Find items, but it is with a "X" (Cancel Cross) which does not looks good comparing to original "Find Items"...

 

Hope for a better Reset Mode.

 

(I wish this will help someone who asked in the forum before on RESETTING to temporary getting things done. I can;t find his post, but hope can help him out)

 

TQ

 

Screenshot (29).pngSelected ItemsScreenshot (30).pngChoose ItemsScreenshot (31).pngAfter Reset

hpkeong
rdshideler
Level: Power Up

Re: Combo Box Reset

Has there been any updates to this?  I am currently using this method, but it isn't perfect.  It still leaves text in the combo box that has to be removed prior to searching again.

Martindeter
Level: Powered On

Re: Combo Box Reset

Hello, 

Is there any other solution or update ? 

Thanks

sulleysullivan
Level: Powered On

Re: Combo Box Reset

Have you seen the response on this post by @CarlosFigueira? It worked for me. 

 

You need to change the DefaultSelectedItems property for the combo box to []. Make sure its the DefaultSelectedItems, not just Default otherwise it won't work. 

 

Then as previously discussed you just use some form of UpdateContext() attached to the OnSelect property of a button to set a variable you can reference in the ComboBox's Reset Property e.g.

 

UpdateContext({ResetCombo: true}); UpdateContext({ResetCombo: false})

 

Then put ResetCombo as the Reset property for any comboboxes you want to reset. 

Martindeter
Level: Powered On

Re: Combo Box Reset

Powerappcase1.PNGPowerappcase1.1.PNGPowerappcase1.2.PNG 

 

 Thanks for your answer !
I've modified the Defaultselecteditems properties,
I've add reset(combobox1)

But when I come back the combobox is the same. I really don't understand.

 

sulleysullivan
Level: Powered On

Re: Combo Box Reset

Have you tried setting the OnSelect property of the Cancel button to the following? 

 

Reset(ComboBox1); Refresh(Table1_1); Navigate('Welcome screen') 

 

I've always used ; as the separator between functions in Powerapps, not And. 

 

Let me know if that helps! 

Martindeter
Level: Powered On

Re: Combo Box Reset

The reset function doesn't accept my combobox. Do you have an idea of why ?                                                        

powerappscase2.2.PNG

 

 

Thanks!

sulleysullivan
Level: Powered On

Re: Combo Box Reset

How about trying this combination: 

 

1. Set the OnSelect of your Cancel button to something similar to my example below. (So including the two UpdateContext() formulas instead of the Reset() one). 

OnSelectExample.PNG

 

2. Set the Reset part of the ComboBox Advanced Settings to match the name of the Context you've just set: ResetCombo

ComboSettings.PNG

 

Highlighted
Guillaume
Level: Powered On

Re: Combo Box Reset

Hello, just wanted to share my experience on this, after spending a few hours ...

 

For me the 2 following options worked :

 

1/ set DefaultSelectedItems = [] and then, when needed , use the function Reset(ComboBox)

 

2/ set DefaultSelectedItems = [] and Reset = varReset ; and then, when nedded, set varReset=!varReset

      ==> meaning that the Reset is done when the value of the Reset property is changed, whatever the value ! (it is resetting when the value is false, as long as the value was true before ...)

 

Of course option 1 is simpler but for some reasons, it sometimes does not work. So in that case I use option 2 which was hard to find out but definitely works.

 

Guillaume

Helpful resources

Announcements
thirdimage

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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,764)