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 / I keep getting 'Expect...
Power Apps
Answered

I keep getting 'Expecting a record but a different schema' message when adding to collection

(0) ShareShare
ReportReport
Posted on by 114

I'm trying to add gallery record to a collection and I'm getting this msg. My expression is this on the onselect property:

UpdateIf(
colLocations,
numID = ThisItem.numID,
{
Facility: Dropdown4_1.Selected,
Location: Dropdown2**.Selected**
}
)

These are the dropdown properties:

Facility dropdown Items Property:

Choices([@'Access Details'].Facility)

I wanted to filter the Location dropdown by the Facility dropdown.

Location dropdown Items Property:

Filter(Locations, Facility = Dropdown4_1.Selected.Value)

 

The problem is the Location. When I am adding location into the collection I am adding it as a Location record. But when i added the defaults into the collection initially (I wanted my gallery to show blanks in the dropdown controls), I'm adding it as the Access Details Location lookup.

Collect(colLocations,
{
Facility: Defaults('Access Details').Facility, //Facility column is a lookup to the Facility list
Location: Defaults('Access Details').Location //Location column is a lookup to the Location list
}
);

 

So how can change the location defaults to match the schema of the location dropdown so that when I add the dropdown into the collection it matches?

Categories:
  • WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    Hi @bpw ,

    What is the Items of Dropdown2 and what type of field is Location ?

  • bp3378 Profile Picture
    114 on at

    Sorry for the confusion.  Dropdown2 is Location.  This is the items property of dropdown2:

    Filter(Locations, Facility = Dropdown4_1.Selected.Value)

  • Verified answer
    WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    @bpw ,

    Assuming you are displaying the Location field in Dropdown2 and Location is a Text field, the Update would be

    Location: Dropdown2.Selected.Location

    If it is a Lookup column, you have caused yourself a bit of complexity here

    Location:
    {
     Value: Dropdown2.Selected.Location,
     Id: 
     LookUp(
     YourLookedUpListName,
     YourLookedUpColumnName = Dropdown2.Selected.Location
     ).ID
    }

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • bp3378 Profile Picture
    114 on at

    That didn’t work. I might have made it confusing.  I think if you can help me filter my location dropdown based on the facility dropdown I’ll be set.   Currently it’s this:

    filter(Locations, Facility = dropdown4_1.selected.value) 


    how can I filter the dropdown using the lookup Location instead of the list Location? 

    I want to filter with this if it’s possible:

    choices([@‘Access Details’].Location)

     

  • bp3378 Profile Picture
    114 on at

    After understanding the concept of lookups more and using your reference example above i was able to make it work now. Thank you very much!!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard