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(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.
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?
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?
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.
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
Learn how to build the business apps that you need.