web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter List/Document L...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 69

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. 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    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.

  • Verified answer
    v-siky-msft Profile Picture
    on at

    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

     

  • robethom Profile Picture
    69 on at

    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?

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    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?

  • v-siky-msft Profile Picture
    on at

    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

  • robethom Profile Picture
    69 on at

    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

     

     

  • Verified answer
    v-siky-msft Profile Picture
    on at

    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

  • robethom Profile Picture
    69 on at

    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. 

  • ACCabrera Profile Picture
    11 on at

    Thanks @v-siky-msft !

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard