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 / Incompatibe types for ...
Power Apps
Answered

Incompatibe types for comparison, these types cannot be compared number, record when using the Patch function

(0) ShareShare
ReportReport
Posted on by 379

I have created a dialog box with 2 buttons Yes and No, when a user clicks on Yes the following code below should be executed:

First I am creating a variable named varID that should hold the ID of the current selected item from my Gallery

Set(varID, GalleryBookings.Selected);

 

Then I want to perform a patch that updates the item named CancelledOnDate and set it to Todays date

but I am getting an error that says Incompatibe types for comparison , these types can't be compared Number, Record

Patch(HotelReservations,LookUp(HotelReservations,ID=varID),{CancelledOnDate:Today()});

 

Not sure what I am doing wrong here.

 

Categories:
  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @Lorem1960 

     

    Try Set(varID, GalleryBookings.Selected.ID)

     

    By leaving out ID, your variable is the full record. Adding this in, just grabs the ID value.

     

    Hope this helps

  • Lorem1960 Profile Picture
    379 on at

    It doesn't seem to like that:

     

    Lorem1960_0-1638361407514.png

     

  • Verified answer
    Gerard Simpson Profile Picture
    2,987 Moderator on at

    Try going down to the other part of your formula, (LookUp(HotelReservations,ID=varID),{Ca...) delete 'varID' and retype it - that should hopefully remove the error adn re-sync the variable.

     

    If that doesnt work, go back to your original formula of Set(varID, GalleryBookings.Selected) and make the following change to your lookup formula (i.e. add '.ID'): (LookUp(HotelReservations,ID=varID.ID)

     

     

  • Lorem1960 Profile Picture
    379 on at

    Great, works now!!

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 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard