We are unable to fetch list items more than threshold limit. For example: you have 10,000 items, there are 3000 item which meets your caml expression.
At first you need to fetch all the items 10,000 and keep it in collection object, then query this collection object using Linq expression.
Please refer to below codes:
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.