cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaxCaines
New Member

Filter() and delegation

Hi

 

I have an app which reads photos from a SharePoint document library. It has a Gallery control whose Items property filters these items based on the file name starting with a room name contained in a context variable which is set from a data card which is part of the Browse gallery I have just come from:

 

    Filter('Comms Rooms Pictures', StartsWith('{Name}',varRoom.Text))

 

This filter works fine, and returns the right photos, but the filter gets a delegation warning, identifying the StartsWith() function and/or ts arguments. If I change '{Name}' to Title, the warning goes away, but as the Title property of all these photos is blank, that doesn't help a lot. I tried changing '{Name}' to '{FilenameWithExtension}',but that makes no difference. I also tried replacing varRoom.Text with a constant like "ABC", but still get the warning. I even tried replacing the StartsWith() by a straight equality test, but that also gets the warning. It seems it's the use of '{Name}' that causes the problem, but surely the filename is the most basic property available. The delegation rules don't mention anything about some properties not being available for delegated filtering.

 

Is there any way to fix this? 

 

Thanks

 

Max

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Yumia

 

No - what I'm concerned about is that we have over 100 rooms, and once we have a few photos of each, if the app is loading all the photos every time someone looks at a single room, this is going to involve a lot of data, which could slow it down and be undesirable if you were not on wifi. So what I want to do is ensure that the filtering actually is delegated. The warning isn't visible to users of the app anyway.

 

As I only have a few photos so far, I've resolved this by setting the Title propery on all of them to the filename, and changed the app to filter on the Title. The warning goes away, so I think I can assume that the filtering is now really delegated. 

 

What surprised me was that SharePoint can handle filtering on the Title property of a document in a library (which is part of the metadata), but not on the filename. But SharePoint isn't a standard file system, after all!

 

Thanks

 

Max

View solution in original post

2 REPLIES 2
v-yuxima-msft
Community Support
Community Support

Hi @MaxCaines ,

 

Do you want to avoid the delegation warning?

You can collect the Library and then filter the collection.

I test as next:

Add one button control, Button1.OnSelect:ClearCollect(test,Picturelibrary)   (Picturelibrary is my library name,you can change it on your side,test is the collection name )

Then Gallery1.Items:Filter(test,StartsWith('{Name}',TextInput1.Text))

On your side Filter(collectionName,StartsWith('{Name}',varRoom.Text))

20190419filterlibrary.PNG

 

Hope this could be helpful.

 

Best Regards.

Yumia

Hi Yumia

 

No - what I'm concerned about is that we have over 100 rooms, and once we have a few photos of each, if the app is loading all the photos every time someone looks at a single room, this is going to involve a lot of data, which could slow it down and be undesirable if you were not on wifi. So what I want to do is ensure that the filtering actually is delegated. The warning isn't visible to users of the app anyway.

 

As I only have a few photos so far, I've resolved this by setting the Title propery on all of them to the filename, and changed the app to filter on the Title. The warning goes away, so I think I can assume that the filtering is now really delegated. 

 

What surprised me was that SharePoint can handle filtering on the Title property of a document in a library (which is part of the metadata), but not on the filename. But SharePoint isn't a standard file system, after all!

 

Thanks

 

Max

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,034)