Hi,
My PowerApp Gallery is showing only one item, when i filter it by the current user.
Without the filter the gallery shows all items.
i am using the following code:
SortByColumns(Filter('Deviation Report'; Author.DisplayName = User().FullName); "Created";Ascending)
and the Author.DisplayName is marked blue, saying
Part of this filter formula can not be run remotely due to service restrictions
Solved! Go to Solution.
I think the first step is to figure out why you aren't getting any results and then see if you need to do anything to address the blue dot.
The first thing you can do since it is easy is to remove "; StartsWith(ComplianceAssetId; TextSearchBox1.Text)" from the filter to verify the textbox search isn't causing the problem.
If you are still having an issue then try adding two labels to your gallery item and update the text property on one to Author.Email and the other to User().Email. Then put the search piece back and remove "Author.Email = CurrentUser.Email;" from the filter, so now it should be returning all items from your list. Once that is done you should be able to use the new labels to compare the actual Author and User email values. It is important to see if they are actually the same.
The blue dot means your query isn't delegable. By default non-delegable queries are limited to the first 500 rows return by the data source before the query is applied. It is possible to increase the row limit to 2,000. If your list in SharePoint has more than 2,000 items then you are going to need another approach.
In SharePoint complex field types (Choice, Lookup, Person/Group, Date and Metadata) aren't delegable but there are functions in PowerApps that also aren't delegable like User(). In your case from the screenshot it looks like you are using both a Person field in SharePoint and the User() function.
Here is more information about non-delegable queries and how to increase the limit
PowerApps data row limit for non-delegable queries
thank you for the reply @Jeff_Thorpe,
my list is a test List with only 6 Items, so that shouldnt cause the issue.
But i am trying to filter my gallery by the current user.
Is there a better way to do this? As right now my gallery either shows only one item or none.
There is a better way to use User(). What you can do is create a variable in the OnStart or OnVisible of the screen to the value of User(). Example Set(gvCurrentUser, User())
Then you would gvCurrentUser in place of User(). This method is more efficient because it only makes one lookup call and then the results can be used anywhere in your code without making another lookup call.
Since you only have six items the formula you have should work even with the blue dot. You will want to test and make sure that Author.DisplayName and User().FullName are returning the user's name as expected. You might want to try comparing email addresses instead of Names.
Here is a blog post by @Meneghino that talks more about User() function and caching the value.
https://baizini-it.com/blog/index.php/2017/08/29/powerapps-user-function-cache-current-user-onstart/
Yes thank you,
i had read this article aswell, and i also tried it with the variable.
I still have the same issue.
the blue dots under Auther.Email = ; and i still cant see any items.
SortByColumns(Filter('Deviation Report'; Author.Email = CurrentUser.Email; StartsWith(ComplianceAssetId; TextSearchBox1.Text)); "Created"; If(SortDescending1; Ascending; Descending))
i checked the data of my record, its all entered correctly.
ClearCollect(LocalDeviationReport; 'Deviation Report')
I dont understand, why i cant see any filtered items
I think the first step is to figure out why you aren't getting any results and then see if you need to do anything to address the blue dot.
The first thing you can do since it is easy is to remove "; StartsWith(ComplianceAssetId; TextSearchBox1.Text)" from the filter to verify the textbox search isn't causing the problem.
If you are still having an issue then try adding two labels to your gallery item and update the text property on one to Author.Email and the other to User().Email. Then put the search piece back and remove "Author.Email = CurrentUser.Email;" from the filter, so now it should be returning all items from your list. Once that is done you should be able to use the new labels to compare the actual Author and User email values. It is important to see if they are actually the same.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
209 | |
194 | |
82 | |
58 | |
38 |
User | Count |
---|---|
303 | |
247 | |
120 | |
83 | |
55 |