Skip to content

Instantly share code, notes, and snippets.

@RyanABailey
Last active August 29, 2015 14:05
Show Gist options
  • Save RyanABailey/6f034e52bec4d02dfb7d to your computer and use it in GitHub Desktop.
Save RyanABailey/6f034e52bec4d02dfb7d to your computer and use it in GitHub Desktop.
CSOM Access List
var clientContext = new SP.ClientContext("/");
var web = clientContext.get_web();
var list = web.get_lists().getByTitle("List Name");
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'FieldName\'/><Value Type=\'Text\'>X</Value></Eq></Where></Query></View>');
var items = list.getItems(camlQuery);
clientContext.load(items);
clientContext.executeQueryAsync(functionSuccess(), functionFailure);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment