cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ell1990
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
v-siky-msft
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
yashag2255
Dual Super User II
Dual Super User II

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!

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

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?

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)

Anonymous
Not applicable

@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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,483)