Skip to main content
Community site session details

Community site session details

Session Id : 5SOtfIg1315ZzZ7ES1wjli
Power Apps - Building Power Apps
Answered

Issue using a Gallery to display files in a Sharepoint Document Library

Like (1) ShareShare
ReportReport
Posted on 17 Sep 2019 22:03:01 by

Hi.  We created a PowerApp to track our group projects.  I created a tab that will show the subfolders and files contained within a specific folder within our Sharepoint Document Library based on the project selected in a table within the PowerApp screen.  When I first set this up two weeks ago, the gallery was displaying both folders and files in my gallery; however as of Wednesday last week, my gallery will only display the subfolders and ignores any files that are within the Sharepoint Document Library Folder.  I've attached screenshots of the app and code and have copied the code below as well.

 

Table Onselect:

UpdateContext({varFolder: "Shared Documents/" & tblProjectList.Selected.'Project Team' & "/" & tblProjectList.Selected.Title & "/"});

 

Gallery Items:

SortByColumns(AddColumns(Filter('Team Documents','Folder path' = varFolder),"Foldersort",If(IsFolder=true,1,2)),"Foldersort",Ascending,"{Name}",Ascending)

 

Blue Test Table Items (visible in the screenshots): I removed the Sort incase that was causing the issue

Filter('Team Documents','Folder path' = varFolder)

*The blue table is a test table to display the results of the code used to populate the gallery as a secondary check while I was troubleshooting.  I can only submit three attachments so I didn't submit the screenshot with this code, but can if needed.

 

Is this a bug within PowerApps or is something missing from my code?

 

Thanks,

Todd

@Anonymous 

Categories:
  • CU10021407-0 Profile Picture
    18 on 10 Feb 2025 at 16:12:45
    Issue using a Gallery to display files in a Sharepoint Document Library
    Uggggh ...... i figured out the problem and I knew it was going to be something extremely simple i overlooked.
     
    My data row limit was still set to 500 and that was apparently affecting it. after i changed it to 2000 it started working again.
     
    /face slap
  • wyotim Profile Picture
    2,545 on 06 Nov 2019 at 22:59:15
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    @Anonymous, today I was working on something similar to what @Anonymous posted and your solution came in quite handy! Thanks for posting it!

  • Community Power Platform Member Profile Picture
    on 25 Sep 2019 at 23:57:29
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    @Anonymous 

     

    Updating the 'Top Count' to 5000 did the trick.  The flow updated the 'ActualFolderPath' for both the files and the folders.  Everything appears to be functioning as I intended and displaying properly in the gallery.  Thanks for all of your help!

  • Community Power Platform Member Profile Picture
    on 19 Sep 2019 at 08:26:57
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    Hi @Anonymous ,

     

    I just found out that the default 'Top Count' is 100 if you leave it blank (even if it says all, this is limited to 100). You can fill in a number between 1-5000. The max here is 5000 or 4999, I don't know exactly, but just fill in a little bit more than the amount of files in your library.

    When you have more than 5000 files in your library, you can fill in a 'Filter Query' which checks if the ActualFolderPath is empty so it will only get these files and you have to execute your Flow a couple of times (depending on how many files you library counts).

  • Community Power Platform Member Profile Picture
    on 19 Sep 2019 at 07:31:56
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    Hi @Anonymous,

     

    Strange that it only updated the folders and not the files. I had no more than 3000 files at that moment in the library and used the advanced options of 'Get files (properties only)' to fill in a 'Top Count' of 3000. Maybe that helps? See the picture below:

     

    Filter Query.png

  • Community Power Platform Member Profile Picture
    on 18 Sep 2019 at 23:59:22
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    @Anonymous ,

     

    You were correct in that it was a delegable error.  When I changed my data row limit for non delegable queries from 500 to 2000, the gallery started working again.  Since that isn't a long term fix, I tried what you suggested by creating a new column titled "ActualFolderPath".  When I updated my code, this was delegable like you said; however it only worked for the subfolders.  The flow did not update the "ActualFolderPath" column for the individual files and so the individual files did not display.  Is there an additional step needed to display the individual files contained within the folder and not just the subfolders?

  • Community Power Platform Member Profile Picture
    on 18 Sep 2019 at 15:01:29
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    The first time you can give all the existing documents the correct value for ActualFolderPath with the Flow shown below.

     

    Create Folder Path.png

     

    This way you can test if this solves the problem. If it does, you need to make the Flow which I mentioned in the previous post. 

  • Verified answer
    Community Power Platform Member Profile Picture
    on 18 Sep 2019 at 14:52:18
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    Hi @Anonymous,

     

    I think that the reason that it doesn't show any files anymore is because there are too many files in the complete Document Library and the 'Folder Path' property is not Delegable. I had a similarly problem a while ago.

    If you add an extra text-column to you Document Library with, for example, the name ActualFolderPath and build a Flow which updates this column with the value of 'Folder Path' every time a new file is created, you can then use this column in you PowerApp instead of 'Folder Path'.

     

    Hope this helps you 🙂

  • Community Power Platform Member Profile Picture
    on 18 Sep 2019 at 14:26:50
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    Hi Mona.

     

    The Blue Test Table does not show the individual files either only the sub-folders (see attached screenshot).  "tblProjectList" is the name of the project table that is on the left side of the screen under the "My Projects" button.  This table displays the information contained in the Sharepoint List "Project List".  "Project Team" is a column within the "Project List" Sharepoint List.  In the reference code of the original post, the "Project Team" is "Applications" which corresponds to the "Applications" folder after the "Shared Documents/"

     

    Thanks,

    Todd

  • v-monli-msft Profile Picture
    on 18 Sep 2019 at 01:43:13
    Re: Issue using a Gallery to display files in a Sharepoint Document Library

    Hi @Anonymous ,

     

    Will the gallery show the files correctly using the Blue Test Table Items? What are the parameters like "tblProjectList", 'Project Team' referring to? Are they SharePoint list name and column names?

     

    Regards,

    Mona

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete