cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Collect from SharePoint List and Filter

Hey everyone. I am having an issue with something that I thought I had correct but once my SharePoint (SP) list went past 2000 entries it turned out I do not have figured out.  So here is what I currently have:

 

ClearCollect(AllMyData,Filter('Daily Summary',Lower('Created By'.Email)=Lower(User().Email)))

 

Basically, in my gallery i want to data to filter to the current user that is logged in.  Simple enough, or so I thought.  I also had, on the app load event, a variable that was the user().Email and I used that in the collect formula but when I did (at least in testing) nothing was returned, which is why it is still User().Email - the lower is just a little catch for people's name's with random capitalization.

Can anyone shed some light on this delegation issue i am having? 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Hi @McG ,

Yes - 'Created By' is not Delegable, neither is User().Email. There is a workaround for the second with a Variable, but you would have to store the first in another text field when a record is created. Also Lower() is not, but this can also be solved.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted

Hi @McG ,

To answer your questions firstly you can run App OnStart in Design view

AppOnStartRun.jpg

 

 

 

 

 

Your CurrentUser can be set here as well as anything else you need to do.

Set(
   CurrentUser,
   User().FullName
)

 

View solution in original post

8 REPLIES 8
Highlighted
Super User III
Super User III

@McG 

The LOWER function cannot be delegated.  It is likely the source of your delegation problems.  You will have to remove lower for your formula to be delegable.

 

Here's a chart showing all the functions that can currently be delegated in SharePoint.

 

Untitled.png 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Super User III
Super User III

Hi @McG ,

Yes - 'Created By' is not Delegable, neither is User().Email. There is a workaround for the second with a Variable, but you would have to store the first in another text field when a record is created. Also Lower() is not, but this can also be solved.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted

Can you elaborate a little further? "...store the first in another text field when a record is created" is above my current knowledge level (or I ma just tired and am missing something quite simple).

 

I can move from "Created By" to just using the User name (it is a choice field on SP).  I can use the office365users to get this info.  Does what I had used for my variable (the app OnStart event) work the way I thought it would? Pass a value to it, and on my collect use this variable to filter the data? 

 

Any additional help on this is greatly appreciated.  

Highlighted

Hi @McG ,

Firstly, this document is essential reading in PowerApps to understand and manage Delegation.

To put it as briefly as possible, there are some tasks that the SharePoint shared service will not do and simply returns the first 500 (or 2000 maximum if you have this set) for the app to sort out. This means that any non-Delegable query will not work properly on record sets over this limit.

The workarounds I was referring to were firstly - set a Variable at App OnStart

Set(vUserName,User().FullName);
Set(vUserName,Lower(vUserName))

You can do the same for email (User().Email) and will get you a Variable set to the Lower case of the relevant item. This can then be used without Delegation issues as the information is "local" and a server call is not required each time it is compared with something. You may not want to use the Lower() bit however if the target is Proper Case.

The next bit is that 'Created By' is not Delegable. You can do a workaround (I call it Data Management) for this (and many other things) with "shadow" text or numeric fields set to Default to the value. 'Created By' is quite easy - just set it to vUserName as above and then you have a text field you can query on.

Does this all make sense to you now?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

 

 

Highlighted

Hi @McG ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hey @WarrenBelz ,  thanks for checking in.  I have taken a few days off from work but from what I have read from what you have posted I think it all makes a little sense.  I will look to implement a solution tomorrow when I back in front of my computer.  I will update then.  Thanks again for following up.  

Highlighted

I have repaired the app to make it work beyond the 2000 limit.  My question is how do I test the app before publishing it, as under the App OnStart, where I set my CurrentUser, does not seem to work in the Preview App.  It does work when I publish it.  I'd rather not mess around with deploying an app that has not been tested.  Any pointers on this last little nugget of my issue?   Besides that, I am very grateful for your help and shared knowledge with my issue.  Thank you. 

Highlighted

Hi @McG ,

To answer your questions firstly you can run App OnStart in Design view

AppOnStartRun.jpg

 

 

 

 

 

Your CurrentUser can be set here as well as anything else you need to do.

Set(
   CurrentUser,
   User().FullName
)

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,940)