{"id":6172,"date":"2020-07-13T13:43:11","date_gmt":"2020-07-13T13:43:11","guid":{"rendered":"https:\/\/www.softreetechnology.com\/?p=6172"},"modified":"2020-07-13T13:43:11","modified_gmt":"2020-07-13T13:43:11","slug":"bulk-update-in-sharepoint-list-items-using-jsom","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/","title":{"rendered":"Bulk Update in SharePoint List Items Using JSOM"},"content":{"rendered":"\n<p>In this blog, we will discuss about bulk update in the SharePoint list items. We are going to use JSOM code to perform the above action. Bulk update is very much efficient as any kind of huge changes or update in the list &amp; list items can be done within fraction of second. In this blog, we have updated the items\u2019 Title from \u201cMyItem\u201d to \u201cNewItem\u201d i.e. in the list which item Title is \u201cMyItem\u201d it will be changed to \u201cNewItem\u201d.          To Perform this please refer the below steps:<\/p>\n\n\n\n<p><strong>Step 1: <\/strong>First get the Current Context.<\/p>\n\n\n\n<p><strong>Step 2: <\/strong>Get the list by its \u201cTitle\u201d in which you want to update the list Items (In this programmed I used the List &#8216;Testlist&#8217;) .<\/p>\n\n\n\n<p><strong>Step 3: <\/strong>To Load the item collection, we used CamlQuery.<\/p>\n\n\n\n<p><strong>Step 4:  <\/strong>Declared an ItemArray for bulk update.<\/p>\n\n\n\n<p><strong>Step 5:  <\/strong>We retrieved all the items by using enumerator.<\/p>\n\n\n\n<p><strong>Step 6: <\/strong> We updated the bulk items.<\/p>\n\n\n\n<p><strong>Follow the complete code:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function BulkItemUpdate() {\n        var itemName = \"MyItem\";\n        var ctx = SP.ClientContext.get_current();\n        var oWeb = ctx .get_web();\n        var oList = oWeb.get_lists().getByTitle('TestList');\n        var camlQuery = new SP.CamlQuery();\n        camlQuery.set_viewXml(\"&lt;View>&lt;Query>&lt;Where>&lt;Eq>&lt;FieldRef Name='Title' \/>&lt;Value Type='Text'>\" + itemName + \"&lt;\/Value>&lt;\/Eq>&lt;\/Where>&lt;\/Query>&lt;\/View>\");\n        \n        var itemColl = oList.getItems(camlQuery);\n        ctx.load(oWeb);\n        ctx.load(oList);\n        ctx.load(itemColl);\n\n            ctx.executeQueryAsync(function () {\n            var itemArray = [];\n            if (itemColl.get_count() > 0) {\n                var itemEnum = itemColl.getEnumerator();\n                while (itemEnum.moveNext()) {\n                    var item = itemEnum.get_current();\n                    var itemId = item.get_item(\"ID\");\n                    var items = oList.getItemById(itemId);\n                    items.set_item(\"Title\", \"NewItem\");\n                    items.update();\n                    itemArray.push(items);\n                    ctx.load(itemArray[itemArray.length - 1]);\n                }\n                ctx.executeQueryAsync(function () {\n                    alert(\"Items are updated Successfully\");\n                }, function (sender, args) {\n                    console.log(\"Request Failed to get TestList Items :\" + args.get_message());\n                });\n            }\n        }, function (sender, args) {\n            console.log(\"Request failed in List \" + args.get_message());\n        });\n    }\n<\/code><\/pre>\n\n\n\n<p>Before performing these steps, the list view is like below: <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/07\/2-2.png\" alt=\"\" class=\"wp-image-6174\"\/><\/figure>\n\n\n\n<p>After performing the bulk update operation, the list item title is now changed to \u201cNewItem\u201d. Refer below image. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/07\/1-3.png\" alt=\"\" class=\"wp-image-6175\"\/><\/figure>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\"><em>Keywords<\/em><\/span><\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>How to update bulk in SharePoint\nList Items Using JSOM<\/li><li>Update SharePoint list items in\nbatch using JSOM<\/li><li>Updating List items in batch using\nJSOM<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we will discuss about bulk update in the SharePoint list items. We are going to use JSOM code to perform the above action. Bulk update is very much efficient as any kind of huge changes or update in the list &amp; list items can be done within fraction of second. In this blog, we have updated the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-6172","post","type-post","status-publish","format-standard","hentry","category-sharepoint"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bulk Update in SharePoint List Items Using JSOM - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bulk Update in SharePoint List Items Using JSOM - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"In this blog, we will discuss about bulk update in the SharePoint list items. We are going to use JSOM code to perform the above action. Bulk update is very much efficient as any kind of huge changes or update in the list &amp; list items can be done within fraction of second. In this blog, we have updated the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-13T13:43:11+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bulk Update in SharePoint List Items Using JSOM - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/","og_locale":"en_US","og_type":"article","og_title":"Bulk Update in SharePoint List Items Using JSOM - Softree Technology","og_description":"In this blog, we will discuss about bulk update in the SharePoint list items. We are going to use JSOM code to perform the above action. Bulk update is very much efficient as any kind of huge changes or update in the list &amp; list items can be done within fraction of second. In this blog, we have updated the [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/","og_site_name":"Softree Technology","article_published_time":"2020-07-13T13:43:11+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Bulk Update in SharePoint List Items Using JSOM","datePublished":"2020-07-13T13:43:11+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/"},"wordCount":217,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/07\/2-2.png","articleSection":["SharePoint"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/","url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/","name":"Bulk Update in SharePoint List Items Using JSOM - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/07\/2-2.png","datePublished":"2020-07-13T13:43:11+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/#primaryimage","url":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/07\/2-2.png","contentUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/07\/2-2.png"},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/bulk-update-in-sharepoint-list-items-using-jsom\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Bulk Update in SharePoint List Items Using JSOM"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=6172"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6172\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=6172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=6172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=6172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}