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 / Lookup field on Form o...
Power Apps
Answered

Lookup field on Form only looksup after I delete and re-select dropdown choice

(0) ShareShare
ReportReport
Posted on by 437 Super User 2024 Season 1

In my form I have an Address Field that looks up the address based on a Pickup Code dropdown selection.  But on existing records, it's not automatically looking up the Address.  I have to delete the value, then re-select (see .gif).  How can I get it to automatically look up the Address when I edit these records?

 

Here's the relevant portion of my code:

DataCardValue26 = Pickup Code Combobox

 

If(Lower(DataCardValue26.Selected.LocationCode) = "home", LookUp(Members, Value(DataCardValue23.Text) = MemberId, StreetNum&" "&Address&" "&Apt&" ("&Address2&")"), LookUp(LocationCodes,DataCardValue26.Selected.LocationCode = LocationCode, DestinationDescription)))

 

RequestsLookupIssue.gif

Categories:
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Brian-M - even though Pickup Code Combobox is indeed displaying a value, I suspect your Pickup Code Combobox is actually returning a blank record. You can verify this yourself by inserting a Label control into the DataCard and entering: 

     

    IsBlank(DataCardValue26.Selected.LocationCode)

     

    Could you confirm what you have in the Default property of the DataCard, and the DefaultSelectedItems property of the Pickup Code Combobox control.

  • Brian-M Profile Picture
    437 Super User 2024 Season 1 on at

    "I suspect your Pickup Code Combobox is actually returning a blank record"... It is definitely returning a blank value.  I had discovered this already and was confused about it, but yes, it's returning a blank value.  Here are my settings:

     

    The Default value on the DataCard: ThisItem.PickupCode

    The DefaultSelectedItems Property of the combobox = {Value:Parent.Default}

     

     

    And I'm having a similar issue with another combobox called "Street" on another form.  What happens here is every time I edit this form, the Street field saves a blank value (wipes out what's already there) unless I go back and re-select the street from the dropdown.  How do I fix these?

     

    BrianM_0-1706908344207.png

     

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Brian-M - typically, we create a Single Line Text Column in SharePoint, and then insert that Single Line Text field as a DataCard into an EditForm control.

     

    We then remove the Text Input control inside that DataCard, and replace it with a different control (in your scenario, a Combo Box control). We also set the Update property of the DataCard to point at the selected value from that Combo Box.

     

    However, if we add the following into the DefaultSelectedItems property, we see the following error:

     

    Amik_0-1706910127573.jpeg

     

    The ComboBox is expecting a Table. As a workaround, and as you have correctly done, we can force a Value into the DefaultSelectedItems property using:

     

    {
     Value: Parent.Default
    }

     

    However, this approach does not work with Choice data types or Single Line Text data types in Dataverse. If for any reason we want to reference an existing saved selection from a ComboBox control, we run into trouble.  If you add a Label control and reference the ComboBox, even though a Value is “displayed”, the ComboBox will still return blank. This is because the DefaultSelectedItems property for that control is expecting a record.

     

    In many scenarios, this may not be an issue because we only need to be confident that the correct value is being displayed for the selected record in our Edit Form. We know if the user "re-selects" the Combo Box and selects a different value, the Combo Box will accept the new selected record and this selection will successfully save on SharePoint.

     

    To supply a record into the ComboBox, we can force the correct record into the ComboBox using the Lookup function. In the DefaultSelectedItems property of the ComboBox, try:

     

    LookUp(
     'Your List',
     'Your Single Line Text Volumn' = Parent.Default
    )

     

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