A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'

If the OData service is of protocol version V4, the correct query URL should be:

$filter=OrganizationId eq 4c2c1c1e-1838-42ca-b730-399816de85f8

No single quotes is required.


I ran into this error querying OData 4.0 through Microsoft Dynamics. The other answers here didn't help unfortunately, even though they are exactly right. My issue was more with handing EntityReference's in filters.

I ended up having to adjust my filter to something like this, to target the foreign key properly. In the example below 'parentaccountid' is the foreign key in the entity I was querying. 'accountid' is the primary key in the accounts entity.

/opportunities?$select=opportunityid&$filter=parentaccountid/accountid eq 5e669180-be01-e711-8118-e0071b6af2a1