cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chris61
Level: Powered On

Filter Collection of CDS Records by owner - getting "binary operator with incompatible types" error

I am trying to create a Collection in my PowerApp using data from the CDS filtering records owned by the logged in user. This is the code so far:

 

Set(gblUserEmail, User().Email);
Set(gblUser, LookUp(Users, 'Primary Email' = gblUserEmail));
ClearCollect(colMyReChecks, Filter('ReChecks', Owner = gblUser))

 

I am getting the "binary operator with incompatible types" error finding "edm.Guid" and "edm.Text". However when I check the variables, gblUser is a 'Record' and the Owner field in the ReCheck datasource is Polymorphic. I have tried using AsType but this does not work and throws delegation errors.

 

This had previously been working last week and now does not.

 

Edit: I have seen solution involving use of the 'Created By' field which works for me but it is important I have this working on the Owner field.

5 REPLIES 5
Highlighted
Dual Super User
Dual Super User

Re: Create a Collection of CDS Records on current owner - getting "binary operator with incompatible types" error

Hey @chris61 

 

Can you try to update your formula as:
Filter('ReChecks',AsType( Owner, [@Users] ).'Full Name' = User().FullName)
 
Make sure you have Users entity added as a connection.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
chris61
Level: Powered On

Re: Create a Collection of CDS Records on current owner - getting "binary operator with incompatible types" error

Thank you for the quick response. It does appear to work, however it throws a delegation warning which I need to avoid due to the possibility of having over 2000 records in the entity. Is there a way around the delegation warning?

Dual Super User
Dual Super User

Re: Create a Collection of CDS Records on current owner - getting "binary operator with incompatible types" error

Hey @chris61 

 

Yes, you can avoid that by changing the expression to:
Filter(AddColumns('ReChecks',"OwnerFullName",AsType( Owner, [@Users] ).'Full Name'), OwnerFullName = User().FullName)
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
chris61
Level: Powered On

Re: Create a Collection of CDS Records on current owner - getting "binary operator with incompatible types" error

Yes it worked, brilliant thank you. I am trying to understand how this works as I hadn't thought to use 'AddColumns'.

 

As I understand it AddColumns adds a new column to 'ReCheck' entity and populates this with the AsType Owner formula, the filter then uses this to compare with the current User. Where exactly does filtering take place? If I have 9000 records is the common data service still doing all the filtering?

chris61
Level: Powered On

Re: Create a Collection of CDS Records on current owner - getting "binary operator with incompatible types" error

Hi @yashag2255 

 

I'm afraid I'm having to reopen this one.

 

The solution you provided does not delegate properly. PowerApps has to download all records in an entity in order to apply the Owner/User criteria therefore making it not work as intended.

 

Any suggestions? I can elaborate further if needed.

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 167 members 5,474 guests
Please welcome our newest community members: