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

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

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

2 REPLIES 2
Highlighted
Dual Super User
Dual Super User

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

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

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

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,716)