cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hpkeong
Community Champion
Community Champion

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

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
Community Champion
Community Champion

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

 

Selected ItemsSelected ItemsChoose ItemsChoose ItemsAfter ResetAfter Reset

hpkeong
rdshideler
New Member

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.

Anonymous
Not applicable

Hello, 

Is there any other solution or update ? 

Thanks

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. 

Anonymous
Not applicable

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.

 

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! 

Anonymous
Not applicable

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

powerappscase2.2.PNG

 

 

Thanks!

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

 

Anonymous
Not applicable

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (3,015)