Forum Discussion

Ted_'s avatar
Ted_
New Member
2 years ago

Combine files - from SharePoint.Contents to SharePoint.Files in the same query

My company has a SharePoint folder with many files inside.

I used the "SharePoint.Contents" method to access a specific folder ("Level 4" see picture) to speed up the refresh.
The files that I need to combine are not found in a single folder, but in subfolders (see date names) of the folder "Level 4", reached with the "SharePoint.Contents" method.
folders schema

 

How can you activate the .Files method after reaching the "Level 4" folder to get back the list of all the files present in the subfolders?

5 Replies

  • Use the .Files method, but immediately apply a heavy path (and file name) filter so you don't have to wait for the entire contents list to come over, and still get all the required file binary links in the same list.

    • Ted_'s avatar
      Ted_
      New Member

      Hello lbendlin,

      thanks for your reply. Can you explain me what you mean for heavy path?

      I have already try to filter on path but require a lot of minutes to preocess the refresh.

       

      thanks in advance 

      • lbendlin's avatar
        lbendlin
        Super User

        As you have experienced, SharePoint.Files enumerates ALL the files on the SharePoint site. That can be many tens of thousands of files. Specifying a folder filter early will help to cut that list down to a more manageable size