cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emfuentes27
Advocate III
Advocate III

Delegation warning when filtering SharePoint list

I have a screen that displays a SharePoint data in a gallery. I need to filter it in a way that people from the same office can see only the items that belong to their office. This is what I'm doing

1. When app onStart (I also tried onVisible screen) I set a variable called whoIsLooking:

 

Set(
    whoIsLooking,
    Office365Users.MyProfile().Department
);

 

For the gallery, I set the Items in a couple of ways:

 

//Filter('Actuarial Map Change Summary', 'Created By'.Department = whoIsLooking)  //Delegation warning

With({userOffice:whoIsLooking}, //Delegation warning
     Filter('Actuarial Map Change Summary',
            'Created By'.Department = userOffice
     )
)

 

Both options filter the data correctly, but they give me a Delegation warning. 

 

Filter Error.jpg

7 REPLIES 7
dave-jorgensen
Advocate V
Advocate V

The SharePoint filtering doesn't have much that can be delegated. the Id field I believe is the only one out of the box that you can filter on without the delegation warning. You could try adding an index to the column you want to filter on, and see if that helps.

v-bofeng-msft
Community Support
Community Support

Hi @emfuentes27 :

The point is that only Email and DisplayName are delegable in the Person data type.

vbofengmsft_0-1634613213498.png

Best Regards,

Bof

 

emfuentes27
Advocate III
Advocate III

Thanks @v-bofeng-msft ! That's bad news, because I need to filter the data in a way that users can only see what has been created by their own office. Email, and DisplayName won't do it.

You'll likely need to download all records to your app in a local collection and filter on the client side.

emfuentes27
Advocate III
Advocate III

Thanks @David_Jorgensen . That's what I'm trying to avoid. The SharePoint list is small now, but it'll get a lot larger in a few month.

Hi @emfuentes27 :

If the number of records is less than 2000, then you don’t need to worry about the issue of deletion.

Best Regards,

Bof

Thanks @v-bofeng-msft , It'll reach more than 2000 in a year or two.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,870)