cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.Stri

I have created a canvas power app, connected to a Dynamics 365 (CRM) datasource and am performing a Lookup function to retrieve and display a record based on the "id" Param which is passed in via a CRM Iframe. This is an option configured on the Iframe control on a CRM form."Pass record object-type code and unique identifier as parameters"


The parameter is passed through as text as you would expect from a url parameter..however when performing the lookup against a datasource ("custom Entity") for a custom entity( new_customentity). e.g.


LookUp('Custom Entity',new_customentityid = Param("id"))


I get the below error:
The requested operation is invalid. Server Response: A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'

 

I have also tried using Text() function as below in an attempt to allign the types.

 

LookUp('Custom Entity',Text( Lower(new_customentityid)) = Lower(Param("id")))

 

However i recieve the same error, Is there any work around here?

 

Thanks in advance

 

B

2 REPLIES 2
Highlighted
Super User II
Super User II

Re: A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.

Hi Brett,

 

I've got this working with the following for a lookup to a Contact entity

 

LookUp(Contacts,Lower(contactid) = Lower(Param("id")))

 

Looks like you just need to leave out the Text conversion.

 

The app works and finds the Contact.  However, I do get a "suggestion" about suboptimal results due to service limitations

Highlighted
Regular Visitor

Re: A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.

Thanks Hamish, 

 

Removing the Text() method and leaving in the Lower()  did get past the type error, however strangely the record was never returned. 

 

If I write the id Param out to a label on the power app form,  I can see the Guid comes through incased in "{" "}"

e.g.

{5EA6DD8B-4A5E-E811-A952-000D3AD24182}

 

For test purposes  I replaced the Param("id") with this Guid String

e.g 

LookUp('Custom Entity',Lower(new_customentityid) = Lower("{5EA6DD8B-4A5E-E811-A952-000D3AD24182}"))

 

When pre viewing I get no returned record...

 

However if I strip the "{" "}" characters ...

 

e.g.

LookUp('Custom Entity',Lower(new_customentityid) = Lower(Mid("{5EA6DD8B-4A5E-E811-A952-000D3AD24182}",2,36)))

 

I do get the record returned as expected.

 

Now when I replace the string Guid with the Param("id") again and publish.

 

e.g.

LookUp('Custom Entity',Lower(new_customentityid) = Lower(Mid(Param("id"),2,36)))

 

I finally get my record returned!!! 

 

Is there a setting that im missing that presents these Guids without the { } ?

 

Cheers 

 

B

 

 

 

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,809)