cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

How to view subfolders and files within a folder in a document library?

Hi all

 

I am a relatively new user to PowerApps and am trying to create an app that will allow users to navigate through a document library.  I have inserted a gallery into the canvas and connected it to the document library.  I then want to be able to select a folder and display the contents of it, in another gallery.

 

Any suggestions would be greatly appreciated.

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @ell1990

 

We can use Folder path to filter the gallery.

1. Set the Items property of left gallery:  Filter(DOCS,'Folder path'="DOCS/") , DOCS is the name of SP document library.

2. Set the Items property of right gallery: Filter(DOCS,'Folder path' = "DOCS/" & Gallery1.Selected.Name &"/" )

Further steps, set the following steps to set the visible of the right gallery.

1. Put UpdateContext({VarGal:false}) to OnVisible of screen

2. Set OnSelect of right arrow to If(VarGal = false, UpdateContext({VarGal:true}),UpdateContext({VarGal:false}))

3. Set Visible of the right property to VarGal

StoG_2.gif

Hope this can help.

Best regards,

Sik

 

View solution in original post

5 REPLIES 5
Highlighted
Dual Super User III
Dual Super User III

Hey @ell1990 

 

To get the first level of folders, you can use the below expression on Gallery1:
Gallery1 -> Items -> Filter(Documents, IsFolder = true && 'Folder path' = "Shared Documents/")
Please check if "Shared Documents" is the correct root path in your case.

To get the second level of folders, you can use the below expression on Gallery2:
Gallery1 -> Items -> Filter(Documents, IsFolder = true && 'Folder path' = "Shared Documents/"&Gallery1.Selected.Name&"/")

To get the third level of folders, you can use the below expression on Gallery3:
Gallery1 -> Items -> Filter(Documents, IsFolder = true && 'Folder path' = "Shared Documents/"&Gallery1.Selected.Name&"/"&Gallery2.Selected.Name&"/")

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Community Support
Community Support

Hi @ell1990

 

We can use Folder path to filter the gallery.

1. Set the Items property of left gallery:  Filter(DOCS,'Folder path'="DOCS/") , DOCS is the name of SP document library.

2. Set the Items property of right gallery: Filter(DOCS,'Folder path' = "DOCS/" & Gallery1.Selected.Name &"/" )

Further steps, set the following steps to set the visible of the right gallery.

1. Put UpdateContext({VarGal:false}) to OnVisible of screen

2. Set OnSelect of right arrow to If(VarGal = false, UpdateContext({VarGal:true}),UpdateContext({VarGal:false}))

3. Set Visible of the right property to VarGal

StoG_2.gif

Hope this can help.

Best regards,

Sik

 

View solution in original post

Highlighted

I am having seemingly random results with some folders in gallery one showing files in gallery2 but then some folders not showing any files in gallery2. Looking at Sharepoint there seems no difference between the folders (contents are similar, e.g. PDFs) and the folders were both created automatically by another process (the same process). Any ideas on anything I maybe missing?

Highlighted

I want to do something similar but I think the issue here is delegation,  None of the commands are delegable as I think the text is stored in multiple lines of text.  So you can only find a max of 2000 (depending on your settings)

Highlighted

@v-siky-msft i had a question , if i wanted to build the same for lets say 3 Levels Example 
Folder-> Folder->Folder_>Files.

There might be a case where in some folders will not have subsequent folders but only files. will the folders then show files or not?

How can I do that?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,812)