Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Incompatible Types for comparison. These types cant be compared: Control, Number

(0) ShareShare
ReportReport
Posted on by 85

I have a gallery named 'DLCGallery'. When I select an item from the gallery it opens in the 'DLCForm (editmode). This works correctly. I added another gallery to the DLCForm named 'TaskGallery'. The datasorce for taskGallery is named 'Tasks' and it has a lookup field named 'Parent' that points to the ID field of the DLC Site Record datasource that is used by the DLCForm. When I select an item (OnSelect) from the DLCGallery I set a variable named 'varSelectedDLCFormID' to the id of the record I'm getting into 

 

Set(varSelectedDLCFormID, ThisItem.ID)
 
I have verified this works. When I input the following formula into the 'items' property of the Taskgallery I get the error above displayed in the thread subject. I've tried uding various casting techniques, but none seem to work.
 
Filter(Tasks, Parent = varSelectedDLCFormID)
  • Verified answer
    ShawnPelletier Profile Picture
    ShawnPelletier 85 on at
    Re: Incompatible Types for comparison. These types cant be compared: Control, Number

    I confirmed that it was not using another control with the same name and I also tried the Parent.ID option and neither worked. I ended up creating a text field with a modified but similar name which I will populate with the ID and that worked. Not ideal, but functional.

  • Re: Incompatible Types for comparison. These types cant be compared: Control, Number

    HI @ShawnPelletier,

    SInce Parent is a LookUp field, I think you should modify as:

    Filter(Tasks, Parent.Id = varSelectedDLCFormID)
  • timl Profile Picture
    timl 33,812 on at
    Re: Incompatible Types for comparison. These types cant be compared: Control, Number

    Hi @ShawnPelletier 

    In your DLCGallery, can you confirm that you haven't named a label/textbox, or some other control with the name ID? If so that's a possible cause of the error since the control name would clash with the data field name.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard