Hello,
I am using Napa in Office365 to develop a web age with several textboxes that I want to have submit their values to my SharePoint list onbuttonclick.
I've tried a couple different methods, and like others who tried them as well (based on the comments at the bottom of the blogs) ran into issues.
Below is what I am trying currently, but get no response; no success or failure message.
'use strict';var siteUrl = 'https://mysitename-public.sharepoint.com/';
function createListItem() {
var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle('crudtest');
var itemCreateInfo = new SP.ListItemCreationInformation();
var oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('Title', 'My New Item');
oListItem.update();
clientContext.load(oListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceeded() {
alert('Item created');
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}