0

I have many lists in SharePoint site. I want to retreive all the items from the list and display on a site. The current user should only see his/her created items not other users items from the lists. Is my query right or can you help me to get the proper one please?

var camlQuery = new SP.CamlQuery(); 
var textCAML = '<View><Query><Where><Eq><FieldRef Name='Author'/></Eq></Where></Query></View>';
camlQuery.set_viewXml(textCAML);
4

It would look like this (from memory):

var camlQuery = new SP.CamlQuery(); 
var textCAML = "<View><Query><Where><Eq><FieldRef Name='Author' LookupId='TRUE'/><Value Type='Integer'><UserID/></Value></Eq></Where></Query></View>";
camlQuery.set_viewXml(textCAML);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.