My objective is to read and extract data from list created in SharePoint site and put it in another list of the same site.
Firstly my problem is that an error message appears where I deploy my application and add my app
function retrieveListItems() {
var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle('List Test');
var camlQuery = new SP.CamlQuery();
var q = '<View><Query><Where><Eq><FieldRef Name=\'email\' /><Value Type=\'Text\'>' + user.get_email() + '</Value></Eq></Where></Query></View>';
camlQuery.set_viewXml(q);
collListItem = oList.getItems(camlQuery);
clientContext.load(collListItem);
clientContext.executeQueryAsync(onQuerySucceeded, onQueryFailed);
}
function onQuerySucceeded(sender, args) {
alert("Suceeded");
![var listItemInfo = '';
var listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext()) {
alert("ok");][1]
}
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}