Dear All,
I am trying following code for creating list. It is creating on HostWeb on office 365.
I want to create list in AppWeb.
Can anyone please tell me how to create list in app web on office 365 using napa tool.
Code:
var listName = "WOW";
var executor;
// Initialize the RequestExecutor with the app web URL.
// Content Type Header is used to tell server what format data in the body contains.
executor = new SP.RequestExecutor(appweburl);
executor.executeAsync({
url: appweburl + "/_api/SP.AppContextSite(@target)/web/Lists?@target='" + hostweburl + "'",
method: "POST",
body: "{ '__metadata': { 'type': 'SP.List' }, 'BaseTemplate': 100,'Description': '" + listName + "', 'Title':'" + listName + "'}",
headers: {
"content-type": "application/json; odata=verbose"
},
success: createListSuccessHandler,
error: createListErrorHandler
});
Thanks,
Harish Patil