cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaxCaines
Level: Power Up

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
MaxCaines
Level: Power Up

Re: Filter() and delegation

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
Community Support Team
Community Support Team

Re: Filter() and delegation

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

MaxCaines
Level: Power Up

Re: Filter() and delegation

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 345 members 6,445 guests
Please welcome our newest community members: