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 / Combo box retains old ...
Power Apps
Answered

Combo box retains old value in edit form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

 

I am facing a weird problem with respect to my combo box.

I have a combo box which shows Sizes (in decimals) on an Edit Form. 

My problem is that anytime I edit a freshly added record, it keeps on showing the last added value in the combo box.

 

For ex: Add Tool 1 with size 1.00

Add Tool 2 with size 2.00

Add Tool 3 with size 3.00

 

Adding is not causing any problem. However, when I am editing the tool, it shows the last value as 3.00 as a default item in the dropdown.

 

I have tried all possible approaches as mentioned below:

 

1. Reset the dropdown using a context variable

2. Set the reset property to true

3. Set DefaultSelectedItems as [] or [""] (tried with both combinations)

4. Cleared the default property of the combo box as well as that of the data card.

 

I am pretty clueless as to why it is retaining that old value from the last "add" operation.

Any suggestions?

 

Thanks,

--Ashep

 

Categories:
  • Verified answer
    wyotim Profile Picture
    2,545 on at

    Hey @Anonymous, what has worked for me is to create a context variable that toggles the reset from true to false and back to true. One common pattern I have used is to set the value to true in the OnVisible property of the screen with the control I am trying to reset and then setting the value to false in the OnHidden property of the same screen.

    // Reset property of the control
    ResetControl
    
    // OnVisible property of the screen the control is on
    UpdateContext({ResetControl: true})
    
    // OnHidden property of the screen the control is on
    UpdateContext({ResetControl: false})

    I have also stacked a toggle for instances where I wasn't changing screens but had a submit button. Basically something like:

    // In the submit button OnSelect property AFTER the submit action has taken place
    UpdateContext({ResetControl: false}); UpdateContext({ResetControl: true})

    Maybe try that out and let me know how it goes?

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Firstly, do you want to change the combo box's defaultselecteditem or drop down's defaultselected value?

    Secondly, do you want to set the combo box's defaultselecteditem to blank?

    The reason why the combo box's DefaultSelectedItems is the latest value is that: it is set to Parent.Default, so it will display the value that the form is binging with.

    If you want to chang it, just unlock the combo box and delect the setting of the DefaultSelectedItems.

    Then, the combo box in edit form will display blank.792.png

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for your reply. Putting the context variable on the OnVisible event seems to have fixed the issue.

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    I'm glad that you've solved your problem.

    If you do not have any other problem, could you please mark my answer as the solution?

    Thanks!

     

    Best regards,

    Community Support Team _ Phoebe Liu

     

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard