cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LewisFoulger
Helper III
Helper III

Reset a form except a dropdown

Hello,

 

I am trying to reset a form when it is submitted via a button, but there is one dropdown which I would like to stay on the same collection, basically one dropdown not to reset.

 

Any ideas?

11 REPLIES 11
RandyHayes
Super User
Super User

@LewisFoulger 

You need only be concerned on the Default property of your dropdown control.  Make sure it has the value that you want your dropdown to be.  Then, when it is reset, it will reset to the default value and show what you want.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi,

 

This would be the case yes, but the box changes after every 5 submissions manually, so would it be possible to stay as the last selected?

RandyHayes
Super User
Super User

@LewisFoulger 

Yes, this is all going to depend on the Default property of your control.

First, to be clear - is it a dropdown or a combobox?  A combobox works much differently.

If it is in fact a dropdown, then what is the current default property of it?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Okay,

 

This is a combo box. (My bad)

 

And the current default of the combo box is clear

RandyHayes
Super User
Super User

@LewisFoulger 

Yes...the default property on the combobox does nothing.  So, what is the DefaultSelectedItems property of the combobox then?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

clear

RandyHayes
Super User
Super User

@LewisFoulger 

Okay...that is why it does not maintain a value when it is reset - because there is nothing there for it to default to!

 

However, with a combobox, the DefaultSelectedItems (DSI) property needs to be set with a record (or table of records if the combobox is multi-select) that matches the Items records.

So what is the Items property of the combobox? 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Yes i understand that, hence me coming for help as i wouldnt know where to start!

 

I would like the box to be clear when the screen is first loaded, and when the form is submitted I would like for the combo box to stay the same as the last submitted choice on the reset/submit button press. 

 

The combo box is not multiselect.

 

The Items Property is :

["Bay 1 HL","Bay 2 HL","Bay 3 HL","Bay 4 HL","Bay 5 HL","Bay 6 HL"]

This is hardcoded selections of a reduced selection from sharepoint.

RandyHayes
Super User
Super User

@LewisFoulger 

Very good.  So, perform these changes:

1) In your OnSuccess action of the Form, add the following formula:

   Set(glbCurrentRecord, Self.LastSubmit)

2) On the DSI property of the Combobox, set it to:

   {Value: glbCurrentRecord.<columnName>}

Replace <columnName> with the name of the column from your data that will contain the value you submitted.

 

Just for your reference, the reason we are specifying the record with the Value (i.e.  {Value: ...) is because your Items property is a table that has a single column called Value (that is what PowerApps will convert the square bracket syntax that you have into a table).

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,621)