I need to find all items from Tasks history (Workflow history) list from SharePoint 2013, but I don't manage to get it exactly right, I have managed to get all items and no items at all.
Any idea, what might be wrong? Since there are items on list with those values:
Code:
List workflowList = context.Web.Lists.GetById(new Guid("{1D356251-D55C-4D7A-97E1-11063B125350}"));
CamlQuery qryWF = new CamlQuery();
qryWF.ViewXml =
string.Format(@"<View>
<Query>
<Where>
<And>
<Contains>
<FieldRef Name='List' />
<Value Type='Lookup'>{0}</Value>
</Contains>
<Eq>
<FieldRef Name='Item' />
<Value Type='Lookup'>{1}</Value>
</Eq>
</And>
</Where>
</Query>
</View>", "aacd3fe2-40a1-4ed3-b5a5-41e00a669848", 76);
ListItemCollection workflowListItems = workflowList.GetItems(qryWF);
context.Load(workflowListItems);
context.ExecuteQuery();