cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahhollan
Helper V
Helper V

dropdown in edit mode has no selected value

I have a dropdown on a form that works great in new mode.  However, when I open the edit form for a specific record number, the dropdown is blank.  How do I get the dropdown to show the previously selected value? 

 

Card default property: ThisItem.'SBU/BU'

Card Update property: ComboBox1_1.Selected.Result

 

Field default property: LookUp('Project Initiation'.'SBU/BU'.,currentid=ID,'SBU/BU')

Field items property: Sort(Distinct([@'SBU/BU'],Title), Result

 

7 REPLIES 7
jKell
Advocate III
Advocate III

@ahhollan  I had an app that was trying to read DropDown list from sharepoint List datasource.

 

I don't know if it is the same issue you are facing (as my dropdown was multiple select)

I had to set my items for the dropdown control to: Choices([@DATASOURCE].columnWithChoices).

 

 

Hopefully that helps-

Joel

I'm wondering if it's because the SharePoint column is a single line of text. How would I need to set up the dropdown properties to return the value then?

Hi @jKell 

One reason why a control will work when the form is New and not it Edit is that the Item property of the form can be Gallery1.Selected provided that the datasource is identical between the gallery and the form.  If the datasources are not identical, then the Item property of the form has to use a Lookup() to a unique field in the same datasource as the form's datasource, so Gallery.Selected will not work but Lookup(datasource, ID=Gallery.Selected.ID) will.  Of course, that is a whole different issue than why a particular dropdown or combobox control doesn't work. When there is a mismatch between the Item property and the Datasource property of a form, note of the controls will show data. 

@ahhollan 

My Sharepoint wasn't a single line of text, it was a CHOICE option. My form in edit mode:

  1. Onselect in the Gallery I set a varable Set(_selectedItem, ThisItem)
  2. Datasource for form is same as Gallery.
  3. item for form is set to new variable _selectedItem
  4. With this structure the DefaultSelectedItems is Parent.Default

 

As @Drrickryp is saying the Gallery and Form need to have the same datasource. If that is the case, the DefaultSelectedItems should be: Parent.Default.

I don't have a gallery set up. I have a newScreen for submitting an item and an EditScreen for editing an item. One correction, the control is a combobox instead of a dropdown. Does this make a difference?

@ahhollan How are you selecting the item to populate your edit screen?

 

There is a function NewForm(NAME_OF_YOUR_FORM) that makes a new row in your datasource

 

There is a function EditForm(NAME_OF_YOUR_FORM) will edit a record in your datasource

But Edit has to be populated with a record.  I am curious how you are doing that without a gallery.

Hi @jKell 

You could do it with a Dropdown or Combobox control outside of the edit form.  Use the Combobox if there are more than 500 items or if you want to search.  The Item property of the edit form would be Dropdown1.Selected or Combobox1.Selected.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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