I want to be able to filter a gallery. I was thinking that I can compare the User().FullName to the Owner value in my table. It appears that Owner is a default column in all of my dataverse(CDS) tables with an Owner data type. When I true and use Owner the comparison becomes non-delegable and I get this error 'Expected text. We expect text at this point in the formula'.
Can I use the Owner column for what I am trying to do? Do I need to write the User().FullName to my Dataverse table with each new record added and use that instead?
The Owner type is polymorphic in that it can be either a User or a Team. You need to use the AsType function to cast it as a User and compare the 'Full Name'. Something else to consider, the Office 365 full name could have middle name whereas Dataverse does not include the middle name, so you might have issues comparing on full name. A safer comparison is to use Email instead. Try either of the examples below (I'm using the Account table to substitute your table name).
Remember to include the Users table as a data source in your canvas app in order for the filter to work.
Comparing Full Names:
Filter(Accounts, AsType(Owner, Users).'Full Name' = User().FullName)
Filter(Accounts, AsType(Owner, Users).'Primary Email' = User().Email)
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.
"Remember to include the Users table as a data source in your canvas app in order for the filter to work"
Would this be the ApplicationUsers Dataverse table in PowerApps for Teams?
Ok. So now I'm trying to get this to work without much luck. Above is what my filter selections look like. Here is what I am trying to do.
I've tried working with an IF statement which hasn't been successful to filter the list based on the checkbox.
I can get the Campaign owner filed working but it is not delegable which I would like it to be.
I'm wondering if it just makes more sense to write the User().Email and User().FullName to the table when they submit a form instead of playing around with the Owner column. I realize I'll have duplicate information but it might be easier to deal with. Thoughts?
Check out new user group experience and if you are a leader please create your group
Check out how to claim yours today!
Test your skills now with the Cloud Skill Challenge.
We are excited to announce that Demo Extravaganza for 2021 has started!
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks