Hi,
I want to filter records on my browse screen with email of current user.I used Office 365 Users Connection.
Logic Which I have written on items property of browse screen:
Error :
Thanks.
Regards,
Vaishali
Solved! Go to Solution.
@vaishalivyas1 wrote:Hi,
I want to filter records on my browse screen with email of current user.I used Office 365 Users Connection.
Logic Which I have written on items property of browse screen:
I'm surprised nobody has said this but calling User() in a function is incredibly slow performance wise. If you can, assign the User() to a variable before you use the filtering you will get better performance.
For example: On Visible on our Home screen (the first screen the App loads) we have the current user stored in a variable CurrentUser
Set(CurrentUser, User())
Then when needed you can perform a lookup on that specific user without calling the User() function by doing things like:
If(CurrentUser.FullName = "John Smith", true,false)
This helped us speed up all our filtering and added a layer of protecting controls simply by capturing the user once and then referring to the variable throughout the app.
In your call to Filter you have to compare the database column with User().FullName OR Office365Users..., not compare them to each other.
It's not an error as such, it's a warning about delegation that you will only look in the 500 first records.
What's your data source, SP, SQL or something else?
Hi @BitLord69
My DataSouce is Dynamics CRM and i want to filter the records on browse screen of current logged in user.
Thanks
Yes, it's completely possible to Filter based on the current user, but you have to compare the current user to a field in your db, NOT to your own profile in Office365.
That means that in order to do so your database must have a column containing either the full name (which you can get from User().FullName), or the e-mail address (that you get from User().Email). If there is no such field you have to add one, or you cannot filter based on it.
Hi @BitLord69
Thanks for replying, I don't have fullname or email fields on that entity but I have created by and Owner fields Data Type of that fields are Lookup can I filter based on that?
Regards,
Vaishali
I have not used CRM at all, so I cannot answer that question; hopefully someone else can. There is one way to find out though - try it! It can't work less, right?! 🙂
Hi @vaishalivyas1,
That depends on the entity which stores the user information. For example, if the user of Created-by field in the Time entries is stored in Accounts entity, then the formula should be in the format below:
SortByColumns(
Filter('Time Entries',
LookUp(Accounts,
accountid=_createdby_value,
emailaddress1)
=User().Email),
"msdyn_timeentryid",
If(SortDescending1, Descending, Ascending))
The accounts entity should be added into the data source before you try this formula.
Add a data connection in PowerApps
Filter, Search, and LookUp functions in PowerApps
Regards,
Michael
I have User entity which stores the User Information.I added User Data source also. So I wrote code like this:
SortByColumns(
Filter('Expense Entries',
LookUp(Users, systemuserid =_createdby_value, internalemailaddress) =User().Email), "createdon", If(SortDescending1, Descending, Ascending))
It is giving me Warning
That relates to Delegation.
https://powerapps.microsoft.com/en-us/tutorials/delegation-overview/
Regards,
Michael
User | Count |
---|---|
140 | |
137 | |
77 | |
76 | |
69 |
User | Count |
---|---|
224 | |
186 | |
68 | |
64 | |
57 |