I have a CamlQuery which I set as follows:
camlQuery.set_viewXml('<Where><Eq><FieldRef Name="Part_x0020_Name" /><Value Type="Text">' + partName + '</Value></Eq></Where>');
Part Name' is an existing field in the table on which I'm running the query, it is a text field, and the variable partName contains a string which is included in this field in the table.
However, the query returns the last item in the table instead of this one (one of the first items, not that it matters).
I've tried deleting the last item to see if there was something specific about that one but it happened again with the new last item.
I'm new to caml so I don't know what it going wrong with this.
Any help would be appreciated.
I tried just querying with:
And this returned the same result, just the last item. I don't think the query is even being used. I can even write:
var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml(); this.collListItem = oList.getItems(camlQuery);
And I get the same result.