How to update Created, Created By, Modified and Modified By in list items using CSOM?


1 Answer 1


Please find the code to update Created, Created By, Modified, Modified By using CSOM.

            ClientContext ctx = new ClientContext("http://siteURL/");
            List list = ctx.Web.Lists.GetByTitle("Info Path");
            ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery());
            ctx.Load(items); // loading all the fields
            User theUser = ctx.Web.EnsureUser("domain\\user");
            foreach (var item in items)
                item["Created"] = "2015-07-03";
                item["Modified"] = "2017-07-03";
                item["Editor"] = theUser;
                item["Author"] = theUser;
                item.Update(); //Apply the change
  • 3
    i too agree with the code given above, but it adds an version to the item if we update the system columns
    – Pradeep
    Apr 24, 2018 at 11:44
  • I couldn't make it work. As soon as ExecuteQuery is executed, the "Created" / "Modified" values revert to their previous values. On another hand, the versioning can be suppressed using List.EnableVersioning (followed by List.Update and ClientContext.ExecuteQuery). Mar 8, 2019 at 13:32
  • You can avoid the extra versions by using item.SystemUpdate() instead of item.Update() - this may not have been available in CSOM when the question was raised (can't remember when it was added).
    – randomsock
    Mar 27, 2019 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.