Oct 21 2016 05:53 AM
I am using CSOM in PowerShell, querying SharePoint Online, but in general, I am looking for a way to retrieve what a specific column/value was on previous versions of a document programmatically.
I can get to the actual previous versions this way, and some basic version values, like url, created date, etc, but can't seem to find anything about the actual custom column values.
$Versions = $item.File.Versions
$clientContext.Load($Versions)
$clientContext.ExecuteQuery()
foreach($Version in $Versions){
Write-Host $Version.VersionLabel
Write-Host $Version.Url
Write-Host $Version.Created
}
Oct 21 2016 06:20 AM
Oct 25 2016 01:46 PM
Sep 01 2017 08:34 AM
That would be for SSOM, not CSOM.
Sep 02 2017 04:36 PM - edited Sep 02 2017 04:37 PM
@Brent Ellis have a look at this update https://dev.office.com/blogs/new-sharepoint-csom-version-released-for-Office-365-august-2017 and especially those classes:
public property Microsoft.SharePoint.Client.ListItem.Versions
public class Microsoft.SharePoint.Client.ListItemVersion
public class Microsoft.SharePoint.Client.ListItemVersionCollection
If they do not work for you, there is a way to do it from the _vti_bin/Lists.asmx service.
More info here: http://blog.velingeorgiev.pro/how-get-list-item-field-versions-data-sharepoint-online. It is not first class solution, but getting version metadata was not available in CSOM few months ago, I do know know if the august 2017 update will offer more on versions metadata (haven't tested it yet). Let me know if works, thanks!
Sep 03 2017 03:13 AM - edited Sep 03 2017 03:13 AM
Hi @Brent Ellis, have a look at the CSOM August 2017 release, especially those classes:
I have not seen what is in these classes yet, if they do not work for you then you can assess the List Item Version Metatdata item from the _vti_bin/Lists.asmx service. More info here: How to get list item field versions data in SharePoint Online. It is not ideal solution ad would be great if the august update offers that, but it is the only alternative I found so far.
Sep 05 2017 10:58 AM
Nov 16 2017 10:23 AM
Hi Brent,
Can you pls share your solution which you implemented. Thanks!
Dinesh
May 25 2022 03:19 PM - edited May 25 2022 03:20 PM
That last link now takes the user to a malware site. I know this post is from 5 years ago, but still...
May 25 2022 03:21 PM
@Velin Georgiev That last link now takes the user to a malware site. I know this post is from 5 years ago, but still...