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 / Incompatible Types For...
Power Apps
Unanswered

Incompatible Types For Comparison - Filter data on 2nd table from related 1st table

(0) ShareShare
ReportReport
Posted on by 5

Hello, please help me, this is driving me nuts.

 

I am having a go at making an asset app, not just to list Assets but also to process and browse the data for Vehicle checks etc.

It's all been a fine learning curve so far, with one exception and that is trying to Filter on a Gallery to only list the Records in CFVehicleCecks related to the one particular Asset being viewed on the previous screen. The Idea I find my Asset (a vehicle) in the Asset list and then from that screen I navigate to a second screen to view the Checks records. I can then select one of those records to see what was entered.

 

I’ve had various formula variations, but always the same issue, ‘Incompatible Types for Comparison’.

 

This is the filter on the Gallery on my Screen.

 

 

Filter(
 CFVehicleChecks,
 CheckAssetID = Param("SelectedAssets"))

 

 

 

This is the OnSelect code on my Button from the screen before the Gallery in question.

 

 

Navigate(BrowseCheckLists, ScreenTransition.Fade, { SelectedAssets: BrowseGallery1.Selected.AssetID})

 

 

 

The below will hopefully give enough info about my Tables, I’m using Dataverse.

 

 CFAssets Table (One):

  • Primary Key: AssetID
  • Other fields, AssetPhoto, AssetName etc.

CFVehicleChecks Table (Many):

  • Foreign Key: CheckAssetID
  • Other fields, including CheckStatus, AssetReading etc.

The relationship between these tables is established through the CheckAssetID field in the CFVehicleChecks table, which is a lookup field referring to the AssetID field in the CFAssets table.

 

ZPM_0-1702058894754.png

 

The note above suggests the problem is that the CheckAssetID is being treated as a Record, and that isn’t compatible with my Text from my Parameter SelectedAssets. Can anyone suggest what and How I should overcome this, please?

 

Please Note that if I remove the filter, the rest of the screen and info on this screen and the next screen all work, and the relationship works as expected.

 

Thank you for your time

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @ZPM ,

     

    Please try:

    With(
     {TheAssetsID:Param("SelectedAssets")},
     Filter(
     VehicleChecks,
     heckAssetID.AssetID= TheAssetsID
     )
    )

     

    Best Regards,

    Bof

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @ZPM,

     

    If this button is inside of the gallery, you could set a variable on this button:

    Set(varFilter, Filter(CFVehicleChecks, ThisItem.AssetID = CheckAssetID.AssetID));
    Navigate(BrowseCheckLists, ScreenTransition.Fade);

     

    Then for the Items property of the second gallery: varFilter

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • ZPM Profile Picture
    5 on at

    Thank you both for your help,

     

    Bof, I think you were the closest looking at your response as you correctly refer to AssetID after CheckAssetID. I'm all new to this and I'm guessing it was obvious, but I got there in the end.

     

    This code is what I have now and it is working as expected, again thank you for your time, very much appreciated.

     

    Filter(
     CFVehicleChecks,
     CheckAssetID.AssetID = (SelectedAssets)

     

     


    @ZPM wrote:

    Hello, please help me, this is driving me nuts.

     

    I am having a go at making an asset app, not just to list Assets but also to process and browse the data for Vehicle checks etc.

    It's all been a fine learning curve so far, with one exception and that is trying to Filter on a Gallery to only list the Records in CFVehicleCecks related to the one particular Asset being viewed on the previous screen. The Idea I find my Asset (a vehicle) in the Asset list and then from that screen I navigate to a second screen to view the Checks records. I can then select one of those records to see what was entered.

     

    I’ve had various formula variations, but always the same issue, ‘Incompatible Types for Comparison’.

     

    This is the filter on the Gallery on my Screen.

     

     

     

    Filter(
     CFVehicleChecks,
     CheckAssetID = Param("SelectedAssets"))

     

     

     

     

    This is the OnSelect code on my Button from the screen before the Gallery in question.

     

     

     

    Navigate(BrowseCheckLists, ScreenTransition.Fade, { SelectedAssets: BrowseGallery1.Selected.AssetID})

     

     

     

     

    The below will hopefully give enough info about my Tables, I’m using Dataverse.

     

     CFAssets Table (One):

    • Primary Key: AssetID
    • Other fields, AssetPhoto, AssetName etc.

    CFVehicleChecks Table (Many):

    • Foreign Key: CheckAssetID
    • Other fields, including CheckStatus, AssetReading etc.

    The relationship between these tables is established through the CheckAssetID field in the CFVehicleChecks table, which is a lookup field referring to the AssetID field in the CFAssets table.

     

    ZPM_0-1702058894754.png

     

    The note above suggests the problem is that the CheckAssetID is being treated as a Record, and that isn’t compatible with my Text from my Parameter SelectedAssets. Can anyone suggest what and How I should overcome this, please?

     

    Please Note that if I remove the filter, the rest of the screen and info on this screen and the next screen all work, and the relationship works as expected.

     

    Thank you for your time


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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard