{"id":2515,"date":"2026-04-28T11:26:32","date_gmt":"2026-04-28T09:26:32","guid":{"rendered":"https:\/\/blog.kodono.info\/wordpress\/?p=2515"},"modified":"2026-04-28T11:26:32","modified_gmt":"2026-04-28T09:26:32","slug":"make-a-field-readonly-in-sharepoint-list","status":"publish","type":"post","link":"https:\/\/blog.kodono.info\/wordpress\/2026\/04\/28\/make-a-field-readonly-in-sharepoint-list\/","title":{"rendered":"Make a field ReadOnly in SharePoint List"},"content":{"rendered":"<p>We can make a field readonly or editable in SharePoint using REST API. I usually use it when I want to update a bunch of SharePoint List Items without changing their Modified date and Editor details. Below is an example to make &#8220;Editor&#8221; readonly again (you&#8217;ll first need to get the Digest Token):<\/p>\n<pre class=\"brush:javascript\">\r\nfetch(`${siteUrl}\/_api\/web\/lists\/getByTitle('${listName}')\/fields\/getbyinternalnameortitle('Editor')`, {\r\n    method: \"POST\",\r\n    headers: {\r\n      \"Accept\": \"application\/json;odata=verbose\",\r\n      \"Content-Type\": \"application\/json;odata=verbose\",\r\n      \"X-HTTP-Method\": \"MERGE\",\r\n      \"IF-MATCH\": \"*\",\r\n      \"X-RequestDigest\": requestDigest\r\n    },\r\n    body: JSON.stringify({\r\n      \"__metadata\": { \"type\": \"SP.FieldUser\" },\r\n      \"ReadOnlyField\": true\r\n    })\r\n  });\r\n<\/pre>\n<p>This method works even if the list has more than 5,000 items.<\/p>\n<p>To verify if a field is readonly or not, we can simply use the endpoint <code>`${siteUrl}\/_api\/web\/lists\/getByTitle('${listName}')\/fields\/getbyinternalnameortitle('Editor')?$select=ReadOnlyField`<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can make a field readonly or editable in SharePoint using REST API. I usually use it when I want to update a bunch of SharePoint List Items without changing their Modified date and Editor details. Below is an example to make &#8220;Editor&#8221; readonly again (you&#8217;ll first need to get the Digest Token): fetch(`${siteUrl}\/_api\/web\/lists\/getByTitle(&#8216;${listName}&#8217;)\/fields\/getbyinternalnameortitle(&#8216;Editor&#8217;)`, { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","hide_page_title":"","footnotes":""},"categories":[15,23,170],"tags":[153,156,123],"class_list":["post-2515","post","type-post","status-publish","format-standard","hentry","category-astuce","category-debug","category-english","tag-astuce","tag-debug","tag-english"],"_links":{"self":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/comments?post=2515"}],"version-history":[{"count":3,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2515\/revisions"}],"predecessor-version":[{"id":2518,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2515\/revisions\/2518"}],"wp:attachment":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/media?parent=2515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/categories?post=2515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/tags?post=2515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}