cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
caruso1058
Microsoft
Microsoft

Filtering Out Items from a Gallery from SharePoint Library

Hello, 

I am attempting to show comments that team members comment on their saved files. Our team saves thousands of files to a particular SharePoint Library. However, I am only interested in displaying files saved to a single sub folder of this Library--Shared Documents/General/PowerBI

 

Because the data is in a SharePoint Library I am having issues finding the right Search or Filter piece of code that allows me to only displays the documents in the PowerBI Folder within my Gallery. 

 

Any help is much appreciated. SP.Library.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Maurits
Resolver III
Resolver III

Hi @caruso1058 , I expect the syntax would be something like:


SortByColumns(Filter(Documents, !IsBlank(Find("PowerBI", 'Full Path'))) , "Modified", Descending)

This way you filter the Documents to show only rows where the text "PowerBI" exists in the 'Full Path'.
When it's not there, the Find function returns blank. So the !IsBlank() function should result in only the files you want to see.





View solution in original post

@caruso1058 ,

No unfortunately.

Currently I do it with a SharePoint Designer (2013) Workflow when the document is filed (a little clunky, but it works), but will have to replace this with a Power Automate Flow when these are retired in 2021 some time.
The one below puts the first two levels of folder names under the base URL into fields called Class and Subject as soon as the document is filed. You can extend this as many levels as you want by repeating the last bit of logic.

You then have fully Delegable Text metadata fields for the folders with the added advantage that you can have SharePoint views of the documents grouped and sorted down to two levels (which we use as our Library view most of the time).

FolderWorkflow.png

 

View solution in original post

7 REPLIES 7
Maurits
Resolver III
Resolver III

Hi @caruso1058 , I expect the syntax would be something like:


SortByColumns(Filter(Documents, !IsBlank(Find("PowerBI", 'Full Path'))) , "Modified", Descending)

This way you filter the Documents to show only rows where the text "PowerBI" exists in the 'Full Path'.
When it's not there, the Find function returns blank. So the !IsBlank() function should result in only the files you want to see.





Hello @Maurits , 

Thanks for your help, I think this puts me very close to my desired result, but due to the size of the Library I think the:

!IsBlank

 is not allowing the Gallery to properly filter the results.

 

Do you happen to know of a trick to navigate around this error for SP Libraries?

 

IsBlank.png

Sigh..delegation 🙂

Maybe this will work:

SortByColumns(Filter(Documents, Find("PowerBI", 'Full Path') > 0) , "Modified", Descending)

 

If the string PowerBI is found within 'Full Path' it returns the starting position of it.

@caruso1058 ,

I will leave you with @Maurits 's good work here but the Delegation issue is 'Full Path'.

The only way I have found to manage this is to write the folder names to text fields in the Library metadata.

Hello @Maurits ,

Thanks for this!

Unfortunately, I have run into the same Delegation issue with that as well.

Fortunately, I learned something new today--Delegation.

Thanks for your help with this. I will try and see if I can do some research and look into what @WarrenBelz  described as writing the metadata as text fields to try and see if that works. 

 

@WarrenBelz, would you happen to know of a blog that would outline what you referenced?  Is this as simple as writing a Calculated Column in SharePoint to duplicate the Folder Title?

@caruso1058 ,

No unfortunately.

Currently I do it with a SharePoint Designer (2013) Workflow when the document is filed (a little clunky, but it works), but will have to replace this with a Power Automate Flow when these are retired in 2021 some time.
The one below puts the first two levels of folder names under the base URL into fields called Class and Subject as soon as the document is filed. You can extend this as many levels as you want by repeating the last bit of logic.

You then have fully Delegable Text metadata fields for the folders with the added advantage that you can have SharePoint views of the documents grouped and sorted down to two levels (which we use as our Library view most of the time).

FolderWorkflow.png

 

Thank you @WarrenBelz,

 

I will dig into this and attempt to implement this.  

Thank you for all of your help!!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,502)