Is there a way to capture the previous version history of list items (probably based on the version number) using CSOM?


In SharePoint 2013 on premise, we cannot get the version history by CSOM. CSOM does not provide such API.

As a workaround, we can use the SharePoint web service.

For more detailed information, you could refer to the post below.

There is a similar post:


| improve this answer | |

You can do it in SharePoint Online via the CSOM, if you have later than the September 2017 version.

Each ListItem will have a Versions property, which is of type ListItemVersionCollection. If you loop through these versions each ListItemVersion inside will have a FieldValues and you can fetch your data from these.

 foreach (var version in item.Versions)
       string versionLabel = version.VersionLabel;
       string versiondate = version.FieldValues["Modified"].ToString();
       string AssignedTo = ((FieldUserValue)version["AssignedTo"])?.LookupValue ?? "";                       


| improve this answer | |

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.