Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
doorssl opened this issue Jan 6, 2025 · 1 comment
Open

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

doorssl opened this issue Jan 6, 2025 · 1 comment

Comments

@doorssl
Copy link

doorssl commented Jan 6, 2025

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.

@matt-davis27
Copy link

Seems to be a duplicate of #882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants