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

Issue with filter by current user in App

So I have an app that filters the gallery to all of the items that have the current logged in user in a specific column.   I'm aware that the User() function gets called every time app is used, which can cause the app to slow down, or expressions with User() to not work at all.    Therefore I used the workaround in this article

 

https://baizini-it.com/blog/index.php/2017/08/29/powerapps-user-function-cache-current-user-onstart/

 

to get around that.  My issue is that when I open the app on my phone it works fine !  but when my colleagues do it doesn't show anything.  Because I can't re-create the issue I don't know how to try and solve it?

 

Just a couple of things to note that might help.  The datasource is a sharepoint list.  The column with the user info is a people or group field and it displays the "DisplayName"  however the User()function doesn't give that option to match so I use the .Email    As I mentioned it works fine for me but  not for anyone else?

 

Any ideas?

 

TIA 

 

2 REPLIES 2
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Issue with filter by current user in App

My rule of thumb here is to see what condition is being tested for each record. What is the email being compared on the left and the one on the right of a condition?

 

For instance, here at Microsoft, I have two email addresses, one being an alias for the other. And one even has capital letters. You will need to check how the email addresses are set up in your table and the User() connector (this is usually the UserPrincipalName).

 

@seadude who can share more about 'debugging' and ways to see what the issue is.

@BrianKnight who has a video on the O365Users connector.

vffdd
Level: Powered On

Re: Issue with filter by current user in App

Thanks @Mr-Dang-MSFT .  I changed the field in the sharepoint list to display the email address rather than the display name and I have a label on the app which shows current user email address.  Just to make sure that the CurrentUser fucntion is pulling in the right address and they match the one in the list.. So their email addr shows fine in that label but it just won't filter the list?   I really have no clue how to resolve it !