Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Create A Task List Item In SharePoint Using JSOM
WhatsApp
Gowtham Rajamanickam
8y
7.8
k
0
0
25
Blog
Steps
Open your SharePoint site.
Edit SharePoint page and add a Content Editor WebPart.
Add a JavaScript code given below in to CEWP.
Save the page and hit F5.
Code snippet
$(document).ready(
function
{
CreateTaskList();
});
function
CreateTaskList() {
var
clientContext =
new
SP.ClientContext(https:
//gowtham.sharepoint.com/tutorials");
var
web = clientContext.get_web();
var
listInfo =
new
SP.ListCreationInformation();
listInfo.set_title(
'Tasks List'
);
listInfo.set_description(
'Task List created by JSOM'
);
listInfo.set_templateType(SP.ListTemplateType.tasksWithTimelineAndHierarchy);
listInfo.set_templateFeatureId(
'B9CE21G7-A437-4A7E-8BC6-946378C850A'
);
var
list = web.get_lists().add(listInfo);
}
function
onQuerySucceeded() {
alert(
'List created sucessfully: '
+ oListItem.get_id());
}
function
onQueryFailed(sender, args) {
alert(
'Request failed. '
+ args.get_message() +
'\n'
+ args.get_stackTrace());
}
SharePoint
JSOM
Up Next
Update A List Item In SharePoint Using JSOM (Announcement List)
Ebook Download
View all
SharePoint Online And Office 365 Administration
Read by 3.6k people
Download Now!
Learn
View all
Membership not found