Skip to content

Read a SharePoint FOLDER with more than 5,000 items. #930

Open
@doorssl

Description

@doorssl

I am using this def to list the files in a sharepoint folder.
---------------- my def ---------------------------------

def list_files_sharepoint(folder_url):
    
    folder = ctx.web.get_folder_by_server_relative_url(folder_url)
    ctx.load(folder)
    ctx.execute_query()

    files = folder.files
    ctx.load(files)
    ctx.execute_query()

    sharepoint_files = [file.properties["Name"] for file in files]
    return sharepoint_files

However, my folder has 7,000 items.

I get this error when I run my function:

'-2147024860, Microsoft.SharePoint.SPQueryThrottledException'

Can someone help me read data from a folder with more than 5,000 items?

I don't have any sharepoint lists, just a folder with +5,000 items.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions