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 / How can I set the defa...
Power Apps
Answered

How can I set the default value of a dropbox to prior selection when the form is in EditMode?

(3) ShareShare
ReportReport
Posted on by 49
THE SITUATION:
I have an app for Purchase Card Purchase Requests. On one screen in my app, Admins can go in, modify requests, assign requests to themselves, change field values, and save the form.
 
The Assigned To dropdown field is getting values from a different list called PCH, and it is filtering the values shown based on the User logged in. This is the formula I've used.
Items: Filter(PCHs, 'Area Office Cluster'.Value in Concat(Filter(PCHs, Admin.Email = User().Email), 'Area Office Cluster'.Value, ","))
 
THE PROBLEM:
When the form is in View mode, you can see the Assigned To field value, however, when I click Edit, and the mode changes to Edit Mode, the Assigned To field is cleared out, and unless I re-select the person it was assigned to, this field will be overwritten as blank when I save the form.  How can I get the selected value to display even when the form is in Edit mode, yet still be able to modify the value if I care to? DefaultSelectedItems is set to Parent.Default and the form is in EditMode.
 
Perhaps there's something I can add to the Edit button at the top? which has the following code: 
OnSelect: UpdateContext({ editMode: true, selectedRecord: Table1.Selected })
 
View mode:
 
After putting form in Edit Mode:
 
 
After saving form, view mode:
 
Any help is appreciated.
 
 
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at
    There are a few important items you have not posted here - what is: -
    • The field name and type that is displayed in the Combo Box
    • The field name and type you are writing / reading from
    • The current Update of the Data Card
    • The DefaultSelectedItems of the Combo Box
  • Michael E. Gernaey Profile Picture
    53,963 Moderator on at
     
    I believe they said its this in the above
    DefaultSelectedItems is set to Parent.Default and the form is in EditMode.
     
  • WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at
    Missed that one, but still need the other items.
  • SM-06031554-0 Profile Picture
    49 on at
     
    • The field name and type that is displayed in the Combo Box: 
      • In the picture, Assigned To is a drop down field named DropdownCanvas1 that displays the Name text field from the PCH list based on the filter I described above. 
    • The current Update of the Data Card: 
      • DropdownCanvas1.Selected.'Name (Title)'
    • The DefaultSelectedItems of the Combo Box:
      • it makes no difference if I leave it blank or enter Parent.Default, the result is the same.
     
    I hope that answered your questions. Thanks for your input!
  • Suggested answer
    WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at
    OK - I was suspecting you may be using a Person field for 'Assigned To' - I now assume it is a Single Line of Text and you are using SharePoint here.
    So if your Items property is
    Filter(
       PCHs, 
       'Area Office Cluster'.Value in 
       Concat(
          Filter(
             PCHs, 
             Admin.Email = User().Email
          ), 
          'Area Office Cluster'.Value, 
          ","
       )
    )
    and you are then displaying the 'Name (Title)' field from the PCHs list, then the DefaultSelectedItems should be
    {'Name (Title)': ThisItem.'Assigned To'}
    The Form Mode (Edit or View) should not matter.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • SM-06031554-0 Profile Picture
    49 on at
     
    Yes, the Name field from PCH is just a text field from a SharePoint list (sorry I didn't clarify), however, I just tried your solution, and the name is still clearing out when I click Edit to make changes to the form.
  • Michael E. Gernaey Profile Picture
    53,963 Moderator on at
     
    Is there anywhere in your code that you are accidentally using Reset property of the control, or using Reset(Control) somewhere?
     
    Is it fair to say its the only one doing that as the others seem populated that are dropdowns/combobox?
     
    BTW also to clarify is it a dropdown(which should have a default) or a ComboBox, they are very different.
     
    Is this the Modern Form?
  • SM-06031554-0 Profile Picture
    49 on at
     
     
    Is there anywhere in your code that you are accidentally using Reset property of the control, or using Reset(Control) somewhere?
    I'm using ResetForm(form) on the Cancel button and after the form successfully submits/saves.
     
    Is it fair to say its the only one doing that as the others seem populated that are dropdowns/combobox?
    Yes, since its the only field getting a value from another SP List (PCH), its only happening here.  In a previous version of the application, where we did not need to filter values from the PCH list, we didn't have this issue because the field was getting the value from the same list.
     
    BTW also to clarify is it a dropdown(which should have a default) or a ComboBox, they are very different.
    it appears as a Dropdown 
     
    Is this the Modern Form?
    Yes
  • WarrenBelz Profile Picture
    155,378 Most Valuable Professional on at
    I can see it is a Modern drop-box and my response was based on that. Make sure you have the fields namd you have displayed correct - is it 'Name (Title)', Name or Title. Which ever is correct is what you need in the code structure {FieldDisplayedInDD: ThisItem.FieldInDataSource}. Also what is the Item and DataSource of the Form ?
  • SM-06031554-0 Profile Picture
    49 on at
     
    The field name to display is 'Name (Title)' and when i add your solution to DefaultSelectedItems, i get the following error:
     
    The Datasource of the form is a SharePoint list called 'Purchase Card Request - New'
    The Item of the form is Gallery1.Selected, as I'm displaying details for whichever item is selected on the gallery to the left.
     
    Thanks again for your time!
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard