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

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

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

Highlighted
New Member

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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