cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate III
Advocate III

Filter List/Document Library to show items in a specific folder

I'm creating an app that is connected to a document library.  The app navigation bar is a list of all the folders in the library.  Once a folder is clicked I'd like for all the documents in that library to be displayed in a dynamic gallery on the page.  I've gotten both the folder list created and a general gallery that shows all listings that are not folders.  What I need assistance is filtering the results to show only for a specific folder. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Filter List/Document Library to show items in a specific folder

Hi @robethom 

 

We can use Folder path to filter the gallery, please try this:

1. Set the Items property of left gallery1: 

 

Filter(LibraryName,IsFolder) 

 

2. Set the Items property of right gallery2:

 

 Filter(LibraryName,'Folder path' = "LibraryName/" & Gallery1.Selected.Name &"/" )

 

GIF_34.gif

Hope this can help.

Best regards,

Sik

 

View solution in original post

Highlighted
Community Support
Community Support

Re: Filter List/Document Library to show items in a specific folder

Hi @robethom 

 

Please ensure the Text property of Label is ThisItem.'File name with extension'.

Snipaste_2020-02-25_11-23-58.png

 

You can debug the issue by hardcoding the folder path into Filter function. Please try as shown below to check if there are any documents shown in the gallery.

If not, please consider removing the SharePoint Library connection and re-add to check again.

Snipaste_2020-02-25_11-27-21.png

Sik

View solution in original post

8 REPLIES 8
Highlighted
Super User III
Super User III

Re: Filter List/Document Library to show items in a specific folder

Hi @robethom ,

You need to put the folder name in the metadata of the SharePoint Library, then you can do a filtered gallery on this value. I have a SharePoint Designer 2013 workflow below that automatically assigns the first two levels of folders (you could easily extend this) into two fields in the library as soon as a document is filed. You will need to get familiar with Workflows, but they are very easy once you have a bit of practice.

WorkflowFolders.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Happy to give you further guidance if you want to go down this track.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Community Support
Community Support

Re: Filter List/Document Library to show items in a specific folder

Hi @robethom 

 

We can use Folder path to filter the gallery, please try this:

1. Set the Items property of left gallery1: 

 

Filter(LibraryName,IsFolder) 

 

2. Set the Items property of right gallery2:

 

 Filter(LibraryName,'Folder path' = "LibraryName/" & Gallery1.Selected.Name &"/" )

 

GIF_34.gif

Hope this can help.

Best regards,

Sik

 

View solution in original post

Highlighted
Advocate III
Advocate III

Re: Filter List/Document Library to show items in a specific folder

This looks to be exactly what I'm looking for. I get no error when I set the function(fx) for gallery2.  However, when I test, it never shows documents within the folder.  Does it matter that I'm using the modern design in SharePoint 365. Does this require the classic library interface?

Highlighted
Super User III
Super User III

Re: Filter List/Document Library to show items in a specific folder

Thanks @v-siky-msft ,

Something I did not think of although we have been using the workflow for a long time. This will only work on one level of folders?

Highlighted
Community Support
Community Support

Re: Filter List/Document Library to show items in a specific folder

Hi @robethom 

 

Could you share some screenshots as follows? What is the  'Folder path' field of documents?

The secondary gallery is filtered based on 'Folder path' field, please ensure the folder path is correct. Please check this:

Snipaste_2020-02-24_12-15-07.png

the code #"F1/" & Gallery2.Selected.Name &"/"# returns "F1/Image Folder/", it means the gallery only displays documents that 'Folder path' field is 'F1/Image Folder/'.

 

You can use a gallery to show the 'Folder path' field of each document to determine whether the filter conditions of the filter function above are met.

Snipaste_2020-02-24_12-22-07.png

Sik

Highlighted
Advocate III
Advocate III

Re: Filter List/Document Library to show items in a specific folder

Sure. I've included my screenshot of how I have the filter setup for my display gallery. I had the folder list print out the 'folder path' and it seems to show the correct path. Am I overlooking something simple?

 

Power Apps Snippet.png

 

 

Highlighted
Community Support
Community Support

Re: Filter List/Document Library to show items in a specific folder

Hi @robethom 

 

Please ensure the Text property of Label is ThisItem.'File name with extension'.

Snipaste_2020-02-25_11-23-58.png

 

You can debug the issue by hardcoding the folder path into Filter function. Please try as shown below to check if there are any documents shown in the gallery.

If not, please consider removing the SharePoint Library connection and re-add to check again.

Snipaste_2020-02-25_11-27-21.png

Sik

View solution in original post

Highlighted
Advocate III
Advocate III

Re: Filter List/Document Library to show items in a specific folder

Made some tweaks after hardcoding it into the filter and it looks to be working thank you for your help.  It's been a life saver. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published 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 (5,778)