cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

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

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

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