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 / Dataverse lookup relat...
Power Apps
Answered

Dataverse lookup relationship beween two tables and collections

(0) ShareShare
ReportReport
Posted on by 6
 
So table Cruises has a One to Many relationship with table Passengers on column 'Cruise ID'
 
2. On a powerapp page, I have a dropdown with Items set to Cruises. (note it only lets me select Cruises NOT Cruises.'Cruise ID' but it displays and allows me to select 'Cruise ID'
 
3. I want to build a collection of all Passengers on a Cruise.  So I have the following OnChange for the Dropdown:
 
// filtered collection
ClearCollect(xcolPassengers2,
    Filter(Passengers, 'Cruise ID'.'Cruise ID' = Dropdown1.Selected.'Cruise ID'
    )
);
 
//test full
ClearCollect(xcolPassengersFull,Passengers);
 
 
When I look at the collections in my Powerapp, xcolPassengers2 has the right number of rows but no data, but xcolPassengersFull has the right number of rows as well as displaying the data. Can anyone help please to 
a. explain why
b. how I can fix so xcolPassengers2 shows the expected data
I have the same question (0)
  • RP-23040940-0 Profile Picture
    6 on at
    Just for overall context  - the next step is to have a Gallery with passengers on the selected cruise and an edit form to add/ amend/ delete passengers into the collection, followed by updating the collection to the dataverse tables.
  • Verified answer
    VASANTH KUMAR BALMADI Profile Picture
    350 on at
    Hi,

    Yeah, this one catches a lot of people when working with Dataverse relationships.

    What’s happening here is related to how lookup (relationship) columns behave in Power Apps. Your ‘Cruise ID’ in the Passengers table isn’t just a simple value—it’s a record reference to the Cruises table. So when you filter like this: 

    'Cruise ID'.'Cruise ID' = Dropdown1.Selected.'Cruise ID'

    it does match correctly (that’s why you’re getting the right number of rows), but the data coming back isn’t being fully expanded in the collection. That’s why you see blank rows in xcolPassengers2 even though the count is correct.

    In contrast, when you collect the full table, Power Apps pulls everything properly, so you see the data.

    The fix is to avoid comparing nested fields like that and instead compare the lookup record directly. Try changing your filter to: 

    ClearCollect( xcolPassengers2, Filter( Passengers, 'Cruise ID' = Dropdown1.Selected ) );

    This works because you’re comparing the entire lookup record instead of drilling into the ID field.

    If for any reason that still behaves oddly, another reliable approach is to compare using the GUID explicitly: 

    Filter( Passengers, 'Cruise ID'.'Cruise ID' = Dropdown1.Selected.'Cruise ID' );

    but then make sure you actually display fields from Passengers in your UI (like Name, Email, etc.), not just the lookup column.

    So in short, the issue isn’t your filter logic being wrong—it’s how Power Apps handles lookup columns and expands data in collections. Comparing the whole record usually avoids this problem.

  • RP-23040940-0 Profile Picture
    6 on at
    Hi Thanks for the reply!
    1. with ClearCollect( xcolPassengers2, Filter( Passengers, 'Cruise ID' = Dropdown1.Selected ) );
    I get this error 
    Incompatible types for comparison. These types can't be compared: Record, Record.
     
    Your second suggestion is what I am going to try I think with directly filtering the table in the GUI rather than trying to build a collection.
     
    Much appreciated
     
     

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 516

#2
Vish WR Profile Picture

Vish WR 444

#3
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

Last 30 days Overall leaderboard