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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Listing Files in a Doc...
Power Apps
Unanswered

Listing Files in a Document Library in Sharepoint With Powerapps App

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm looking to use a gallery or data table (I've tried both) to display a listing of files in a Sharepoint document library in a canvas app. This feature was originally announced in March 2019. I've reviewed the documentation and the other questions asked within the community (this post was helpful), and have had success, however it only lists a handful of the files (12 qty) versus the whole list of files.   Here is a variation on what I've used in my gallery (also similarly attempted in a data table). I've changed directory names, of course:

 

Filter(Documents, IsFolder=false&&'Folder path' = "Shared Documents/Directory to View/")

 

I've reviewed the files, and there is nothing odd about them, and they have the same structure and extension (.csv) as the others. I'm not sure if I'm doing something in correctly in the above snippet, or if there some known limit to the number of files that can be listed.  Some extra information that may be helpful:

  • Users of the app also have full access to the SP site
  • There are no spaces or blanks within the file and directory names, to avoid issues (e.g. Column_x0020_Name)
  • The file names are unique
  • All files are .csv
  • There is one subdirectory within this directory (I'm not sure if that would be a factor, we're not trying to view it)
  • I am not seeking to list or access subdirectories, just the files

Thanks for any guidance or insight.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,471 Most Valuable Professional on at

    If you are trying to list all the files then the second part of your formula isn't necessary.  That will limit the files listed to only the ones in that specific subdirectory.  It will also filter out any files from child directories below the subdirectory.  If you want to list all the files starting at a particular subdirectory and below use the following.

     

    Filter(Documents, IsFolder = false && StartsWith('Folder path', "Shared Documents/directory to view"))

    The one other potential problem is that the IsFolder check is non-delegable so this filter will only apply to the first 500 (2,000 if data row limit is extended) files in the library.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks so much for the reply!I am trying to limit to the files to "directory to review" (subdirectory) and do not want to include items in a child directory. 

     

    (I should mention, "directory to view" is a fictional name for posting purposes.)

     

    With your formula and mine, it still only shows 12 files, whereas there are 21 in "directory to review".

     

    But your mention of a child directory got me thinking - since there was one.  I removed the child, to see if it was impacting it for some reason. While doing so, I renamed the files in the child, and placed them in the main directory ("directory to view"). Those files then appeared, making it 15 that are viewable.  So now I could see that I had some files that were excluded for some reason. All of these .csv files are created via a Power Automate Flow, and are automatically saved in the directory weekly (this app was created to monitor the backup process).  The ones that are showing - as it turns out - were modified by me since they were manually moved to the directory when I set up the process. The moving of the child directory files was the same case.  I'm now wondering if there is some issue of permissions, though I cannot see a difference in the files. 

  • Pstork1 Profile Picture
    69,471 Most Valuable Professional on at

    Assuming the Power App is running with your security context if you can see the files in SharePoint they should also show for you in Power Apps.  I have not been able to duplicate your issue. All the files in the subdirectory show for me.  But I haven't actually tried with a .CSV.  It should either be permissions or maybe that the connector is filtering out certain types of files.  If you rename one of the .CSV files to have a different extension does it then show up?

  • SergiPino Profile Picture
    6 on at

    hi,

    I think you're running into a delegation issue. Unfortunately all fields seem to be non delegable in the Documents folder. So probably the 12 files you see are among the first 500 (or 2000) rows/files in your Sharepoint. Due to the delegation row limit you can't see any file beyond the limit.

    Even StartsWith than uses to be delegable with all Lists in SharePoint is not delegable when used in the Documents file list.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 875

#2
Valantis Profile Picture

Valantis 530

#3
11manish Profile Picture

11manish 432

Last 30 days Overall leaderboard