Hi @Jack Le
We are unable to fetch the List items more than threshold limit. For example: you have 10,000 items, there are 3000 item which meets your caml expression. But it won't retrieve rather you will get exceed threshold limit exception.
You can fetch all the items/documents 10,000 and keep it in collection object and query this collection object using Linq expression. Please refer to below code
var web = clientContext.Web;
var list = web.Lists.GetByTitle("listName");
clientContext.Load(list);
clientContext.ExecuteQuery();
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "<View Scope='RecursiveAll'><RowLimit>5000</RowLimit></View>";
List<ListItem> items = new List<ListItem>();
do
{
ListItemCollection listItemCollection = list.GetItems(camlQuery);
clientContext.Load(listItemCollection);
clientContext.ExecuteQuery();
//Adding the current set of ListItems in our single buffer
items.AddRange(listItemCollection);
//Reset the current pagination info
camlQuery.ListItemCollectionPosition = listItemCollection.ListItemCollectionPosition;
} while (camlQuery.ListItemCollectionPosition != null);
var filteritems = items.Where(tt =>(tt.FieldValues["Column_A"] != null) &&
(tt.FieldValues["Column_B"] != null) &&
(tt.FieldValues["Column_C"] == "")
);
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.