No idea for Large List View CSOM

developer sp1 461 Reputation points

Have a large list about 10k items.

Now I'm getting all list items in CSOM but the code snippet throw List View Threshold error.

Can we overcome this error, I real want this list data in CSOM and export to Excel CSV.

Thanks for any help

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,432 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerryzy 10,421 Reputation points

    Hi @developer sp1 ,

    Use ListItemCollectionPosition for paging the large list items collection, here is a sample code for your reference:

    ClientContext clientContext = new ClientContext("weburl");  
    List list = clientContext.Web.Lists.GetByTitle("ListTitle");  
    ListItemCollectionPosition position = null;  
        CamlQuery camlQuery = new CamlQuery();  
        camlQuery.ListItemCollectionPosition = position;  
        camlQuery.ViewXml = @"<View>  
                                  <FieldRef Name='Title'/>  
        ListItemCollection listItems = list.GetItems(camlQuery);  
        position = listItems.ListItemCollectionPosition;  
        foreach (ListItem listItem in listItems)  
            Console.WriteLine("Title: {0}", listItem["Title"]);  
    while(position != null)  

    Large list issue with CSOM

    Best Regards

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful