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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Problem with Combo box...
Power Apps
Answered

Problem with Combo box in Edit Form - not displaying value from selected record I want to edit

(0) ShareShare
ReportReport
Posted on by 45
My two questions are included in blue below
I have a screen that has 2 sections:
Top Section
Gallery where user selects a record and can click on an edit icon per record
Bottom Section
A form where a user can edit that selected record or edit an existing record.
Adding a record works well.
 
I am having a problem with the combo box not loading the selection made in the gallery. The other fields on the form including text and toggle load the information, but the combo box is not.
 
Here is what I have set up:
Edit Icon per row on the Gallery
  • On Select
    • Set(NewSectorSpecificRecord, false);
    • Set(varSectorSpecific,ThisItem);
    • ResetForm(frmAddSectorSpecific);EditForm(frmAddSectorSpecific);
Form under the gallery
  • Item Property - varSectorSpecific
  • Datasource property for the form is List-1
  • What should the Defaultmode property be set as?
    • If(NewSectorSpecificRecord = true,FormMode.New,FormMode.Edit)
Combo box in the form
  • Is not displaying the field relating to the record selected in the gallery.
  • DefaultSelectedItems property of the Combo box
    • Distinct(Filter(List-2,ID=ThisItem.CreditTypeID),Title)
    • I'm looking up the Title from List-2 for the selected item. The field in List-1 is CreditTypeID and this number is the ID from List-2 ie it simulates a relationship.
  • Items property of the combo box is List-2
  • Why is the Credit Type combo box blank? It seems to be loading the options to be selected from the lookup, but I want the actual value selected from the gallery above to be in this field when the edit button is clicked.
Thank you for any advice.
 
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Distinct returns a column called value. What is the primary text of your combobox?
  • Verified answer
    WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    Firstly, you need to get away from a Variable being the Item of your Form (query directly to the data source)
    LookUp(
       'List-1',
       ID = varSectorSpecific.ID
    )
    DefaultMode does not really matter - you should be calling the mode as you need it - NewForm(YourFormName), EditForm(YourFormName), ViewForm(YourFormName)​​​​​​​
    The code you have posted looks more like the Items of the Combo Box
    Distinct(
       Filter(
          List-2,
          ID = ThisItem.CreditTypeID
       ),
       Title
    )
    DefaultSelectedItems will depend on what type of field you are reading from / writing to - I am going to take a guess here it is a Lookup column so it would be something like
    {Value: ThisItem.YourLookupFieldName.Value} 
    Also the Update of the Data Card should then be
    {
    Value: ComboBoxName.Selected.Value,
    Id:
    LookUp(
    'List-2',
    Title = ComboBoxName.Selected.Value
    ).ID
    }
    An observation (if my guess is correct) - SharePoint Lookup columns are mostly unnecessary with Power Apps and have the potential to cause you unwanted and unneeded complexity and restrictions - I have never used them. It is generally a better idea to get the required field items directly from the second list (you are doing this anyway) with Power Apps and write back to a Text column.
     
    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    Buy me a coffee
  • MZ-18110459-0 Profile Picture
    45 on at
    Thank you, some really good pointers here.
     
    I will change the variable referencing.
     
    In the end, I changed the combo box to a drop down list. I also changed the drop down list Items property to 
    Distinct(List-2,Title)
    and it worked a treat.
     
    Thank you so very much, the responses and support are really strengthening my knowledge and refining my approach to solutions. Its making a big difference - thank you.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard