web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Don't want dropdown to...
Power Apps
Answered

Don't want dropdown to reset

(0) ShareShare
ReportReport
Posted on by 35

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

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @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?

     

  • Kiwi22 Profile Picture
    35 on at

    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 Profile Picture
    76,299 Super User 2024 Season 1 on at

    @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?

  • Kiwi22 Profile Picture
    35 on at

    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 Profile Picture
    76,299 Super User 2024 Season 1 on at

    @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.

  • Kiwi22 Profile Picture
    35 on at

    Unfortunately it's still doing the same.

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @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?

  • Kiwi22 Profile Picture
    35 on at

    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

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @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!

     

  • Kiwi22 Profile Picture
    35 on at

    Fantastic! You've done it. Thank you very much Randy. I really appreciate it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard