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:
Thanks for any guidance or insight.
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.
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.
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?
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.
Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.
Check out the new Power Platform Community Connections gallery!