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

Don't want dropdown to reset

Hi there

 

I have a dropdown that is outside of my gallery. The gallery edits and saves vehicle registration data to a SharePoint Library. The problem is that when I press the Save button my dropdown value resets. I want to keep the selection. Any suggestions? Thanks        Issue with powerapp Vehicle.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@Kiwi22 

Yep...as suspected, you're changing the record source for the dropdown.  No worries though.

 

So I looked back over my replies and noticed that I was looking at your image and gave some formula examples, they were for the wrong one.  Let's roll back to an earlier post:

 

Change the formula on the OnChange action to the following:

Set(MySelection1, Self.Selected.PNumber)

Then change your Default property of the Dropdown to:

MySelection1

Remove the formula on the OnSelect action.

 

THAT should resolve 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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

View solution in original post

11 REPLIES 11
RandyHayes
Super User III
Super User III

@Kiwi22 

A couple of questions:

1) Is this a Dropdown control or a ComboBox?

2) The Items property of the control is obviously the same as the datasource of the EditForm.  What is the Items property?

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Hi Randy

 

1) This is a dropdown

2) Forgive me if I'm not answering your question. I think what you're asking is what I have in the gallery items. If this is the case I have:  Filter(ListVeh2,PNumber = ChooseVehicle.Selected.PNumber). 

 

RandyHayes
Super User III
Super User III

@Kiwi22 

Actually, it is the Items property of your Dropdown that I was interested in.  

I am just now realizing that you actually have your entry "form" in a Gallery.  Curiously any particular reason for that?  Does the filter for that Gallery return multiple items that can be edited?

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Thanks for your assistance

 

Okay, see below the information for my dropdown.Dropdown.JPG

The only reason I have my entry form in a gallery is because it was the the only way I could get my app to do what I needed it to do. My app is connected to two SharePoint lists. The first collects all registration details(this is the screen you see) and the second records vehicle pre-start checks. The only fields that can be edited are the ones you can see.

 

FYI

How my app works at the moment.

 

1)The dropdown as shown on my first image selects the vehicle to be inspected. On the same screen you can see/edit the registration details. Once you save this it goes to a SharePoint List and a new screen opens. 

2)On the next screen I have a label that mirrors the dropdown from the previous screen(because it will be for the same vehicle). This is where the pre-start checklist is completed. Once the user saves this, it goes to a separate SharePoint list. My Vehicle number is the value that ties it all together.

Screen 2 App.JPG

 

RandyHayes
Super User III
Super User III

@Kiwi22 

Thanks for the detail - always welcome!!

 

So, let's first change your OnSelect property of the ChooseVehicle dropdown control to:

Set(MySelection1, Self.Selected.PNumber)

Then change your Default property of the Dropdown to:

MySelection1

 

Let's see where that gets 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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Unfortunately it's still doing the same.

 

RandyHayes
Super User III
Super User III

@Kiwi22 

So, I've been focused on some of the common scenarios, but reading back to your original post - you mention that all is well until you hit Save - what is the Formula on the save button?

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

I have a on select and the formula is:

Patch(ListVeh2,ThisItem, {'Wof Expiry':DPCChangeWOFDATE.SelectedDate},{'Registration Expiry':DPCChangeRegistrationDATE.SelectedDate},{'COF Expiry':DPCChangeCOFDATE.SelectedDate});UpdateContext({EditThis: false})

 

Not sure if it makes any difference but the cancel/edit button has a toggle and this makes the save button and the date input fields disappear. See photo below when it's activated. Probably not important, but thought I'd mention it anyway.

 

Editcancel.JPG

RandyHayes
Super User III
Super User III

@Kiwi22 

Yep...as suspected, you're changing the record source for the dropdown.  No worries though.

 

So I looked back over my replies and noticed that I was looking at your image and gave some formula examples, they were for the wrong one.  Let's roll back to an earlier post:

 

Change the formula on the OnChange action to the following:

Set(MySelection1, Self.Selected.PNumber)

Then change your Default property of the Dropdown to:

MySelection1

Remove the formula on the OnSelect action.

 

THAT should resolve 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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

View solution in original post

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,282)