Skip to content

Instantly share code, notes, and snippets.

Created April 7, 2017 01:41
What would you like to do?
function sp_demo(customers){
var context = getContext();
var collection = context.getCollection();
var collectionLink = collection.getSelfLink();
for (var x in customers) {
if (!customers[x].Name) throw "Invalid Customer Name";
collection.createDocument(collectionLink, customers[x]);
var response = context.getResponse();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment