cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ell1990
Level: Powered On

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
Microsoft v-siky-msft
Microsoft

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
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!

Microsoft v-siky-msft
Microsoft

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (5,044)