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 / Filter Collection of C...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Anonymous 

     

    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!
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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?

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Anonymous 

     

    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!
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard