New method CheckedOutFiles() is not returning results

%3CLINGO-SUB%20id%3D%22lingo-sub-178922%22%20slang%3D%22en-US%22%3ENew%20method%20CheckedOutFiles()%20is%20not%20returning%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-178922%22%20slang%3D%22en-US%22%3E%3CP%3ECan%20someone%20confirm%20my%20findings%2C%20possible%20issue%20with%20the%20new%20CSOM%20(March%20release)%20and%20CheckedOutFiles()%20method%3F%20It%20is%20always%20returning%200%20items.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EExpected%20or%20Desired%20Behavior%3C%2FSTRONG%3E%3CBR%20%2F%3EWhen%20requesting%20the%20Checked%20Out%20Files%20in%20the%20new%20CSOM%2016.1.7521.1200%20I%20don't%20get%20any%20results%20back.%20Eventhough%20I'm%20site%20collection%20admin%20on%20the%20site%20collection%20and%20within%20the%20document%20library%20where%20I%20request%20the%20files%20I%20have%20one%20checked%20out%20file.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EObserved%20Behavior%3C%2FSTRONG%3E%3CBR%20%2F%3EI%20would%20expected%20the%20method%20Microsoft.SharePoint.Client.List.GetCheckedOutFiles()%20to%20return%20the%20checked%20out%20files.%20In%20this%20case%2C%20one%20file.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESteps%20to%20Reproduce%3C%2FSTRONG%3E%3CBR%20%2F%3EI%20used%20both%20the%20following%20PowerShell%20script%2C%20and%26nbsp%3BC%23%20to%20retrieve%20the%20checked%20out%20files.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%24siteUrl%20%3D%20%22https%3A%2F%2Fm365x123456.sharepoint.com%2Fsites%2Fvendors%22%0A%0A%24ctx%20%3D%20New-Object%20Microsoft.SharePoint.Client.ClientContext(%24siteUrl)%0A%24ctx.AuthenticationMode%20%3D%20%5BMicrosoft.SharePoint.Client.ClientAuthenticationMode%5D%3A%3ADefault%0A%24ctx.Credentials%20%3D%20New-Object%20Microsoft.SharePoint.Client.SharePointOnlineCredentials(%24loginname%2C%20%24pwd)%0A%0A%24web%20%3D%20%24ctx.Web%20%0A%24ctx.Load(%24web)%20%0A%24ctx.ExecuteQuery()%0A%0A%24list%20%3D%20%24web.GetList(%22%2Fsites%2Fvendors%2FShared%20Documents%22)%0A%24ctx.Load(%24list)%0A%24ctx.ExecuteQuery()%0A%0A%24list.Title%0A%0A%24files%20%3D%20%24list.GetCheckedOutFiles()%0A%24ctx.Load(%24files)%0A%24ctx.ExecuteQuery()%0A%0A%24files.Count%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOutput%3A%200%3C%2FP%3E%0A%3CP%3EExpected%20output%3A%201%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESharePoint%20Client%20Browser%20(C%23)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EBelow%20a%20screenshot%20of%20a%20preview%20version%20of%20the%20SPCB%20which%20retrieves%20the%20files%20via%20CheckedOutFiles().%20The%20count%20is%200%20(see%20%231).%20Even%20though%20the%20library%20contains%201%20file%20which%20is%20checked%20out%20(see%20%232).%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F31454i94EBCEF170EF3EB5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22SharePointClientBrowserPreview-CheckedOutFiles.png%22%20title%3D%22SharePointClientBrowserPreview-CheckedOutFiles.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-264336%22%20slang%3D%22en-US%22%3ERe%3A%20New%20method%20CheckedOutFiles()%20is%20not%20returning%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-264336%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Bram%2C%20same%20here%3A%20still%20not%20returning%20the%20expected%20results...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-264104%22%20slang%3D%22en-US%22%3ERe%3A%20New%20method%20CheckedOutFiles()%20is%20not%20returning%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-264104%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Paul%2C%20it's%20been%20a%20while.%20But%20what%20is%20your%20experience%20now%3F%20It%20looks%20I%20still%20have%20the%20same%20behavior.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202830%22%20slang%3D%22en-US%22%3ERe%3A%20New%20method%20CheckedOutFiles()%20is%20not%20returning%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202830%22%20slang%3D%22en-US%22%3EIt%20will%20give%20count%20only%20if%20Files%20are%20in%20%22No%20Checked-in%20File%20version%22.%20For%20me%20it%20returns%20count%20but%20%22TakeOverCheckOut%22%20method%20not%20working.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-181632%22%20slang%3D%22en-US%22%3ERe%3A%20New%20method%20CheckedOutFiles()%20is%20not%20returning%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-181632%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20response.%20I'll%20keep%20monitoring%20the%20feature%20and%20see%20if%20it%20starts%20working%20in%20upcoming%20weeks.%20The%20SharePoint%20Client%20Browser%20is%20ready%20for%20checked%20out%20files%2C%20check%20out%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fbramdejager%2Fspcb%2Freleases%2Ftag%2Fv3.5%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Elatest%20release%3C%2FA%3E%20for%20SharePoint%20Online.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKeep%20you%20posted%20on%20updates%20when%20it%20starts%20working%20%3B)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-181580%22%20slang%3D%22en-US%22%3ERe%3A%20New%20method%20CheckedOutFiles()%20is%20not%20returning%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-181580%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20change%20is%20currently%20rolling%20out%20in%20the%20server%20side%2C%20so%20there%20might%20be%20some%20delays%20for%20the%20APIs%20to%20work%20like%20also%20noted%20in%20the%20CSOM%20release%20blog%20post.%20We%20need%20to%20get%20things%20out%20before%20we%20can%20enable%20the%20APIs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%20issue%20still%20exists%20within%20upcoming%20week(s)%2C%20we%20need%20to%20have%20a%20closer%20look%20on%20this%20and%20would%20suggest%20submitting%20an%20issue%20at%20%3CA%20href%3D%22http%3A%2F%2Faka.ms%2Fspdev-issues%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Faka.ms%2Fspdev-issues%3C%2FA%3E%2C%20so%20that%20we%20can%20trace%20that%20using%20our%20official%20process.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-179327%22%20slang%3D%22en-US%22%3ERe%3A%20New%20method%20CheckedOutFiles()%20is%20not%20returning%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-179327%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F369%22%20target%3D%22_blank%22%3E%40Vesa%20Juvonen%3C%2FA%3E%26nbsp%3Bdo%20you%20have%20similar%20experiences%20from%20other%20users%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-178953%22%20slang%3D%22en-US%22%3ERe%3A%20New%20method%20CheckedOutFiles()%20is%20not%20returning%20results%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-178953%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Bram%2C%20I%20quickly%20wrote%20a%20console%20app%20and%20I%20can%20confirm%20this%20behavior%3A%20always%20returning%200%20here%20too...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
MVP

Can someone confirm my findings, possible issue with the new CSOM (March release) and CheckedOutFiles() method? It is always returning 0 items. 

 

Expected or Desired Behavior
When requesting the Checked Out Files in the new CSOM 16.1.7521.1200 I don't get any results back. Eventhough I'm site collection admin on the site collection and within the document library where I request the files I have one checked out file.

 

Observed Behavior
I would expected the method Microsoft.SharePoint.Client.List.GetCheckedOutFiles() to return the checked out files. In this case, one file.

 

Steps to Reproduce
I used both the following PowerShell script, and C# to retrieve the checked out files.

 

$siteUrl = "https://m365x123456.sharepoint.com/sites/vendors"

$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$ctx.AuthenticationMode = [Microsoft.SharePoint.Client.ClientAuthenticationMode]::Default
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($loginname, $pwd)

$web = $ctx.Web 
$ctx.Load($web) 
$ctx.ExecuteQuery()

$list = $web.GetList("/sites/vendors/Shared Documents")
$ctx.Load($list)
$ctx.ExecuteQuery()

$list.Title

$files = $list.GetCheckedOutFiles()
$ctx.Load($files)
$ctx.ExecuteQuery()

$files.Count

 

 

Output: 0

Expected output: 1

 

SharePoint Client Browser (C#)

Below a screenshot of a preview version of the SPCB which retrieves the files via CheckedOutFiles(). The count is 0 (see #1). Even though the library contains 1 file which is checked out (see #2). 

 

SharePointClientBrowserPreview-CheckedOutFiles.png

7 Replies
Highlighted

Hi Bram, I quickly wrote a console app and I can confirm this behavior: always returning 0 here too...

 

 

Highlighted

@Vesa Juvonen do you have similar experiences from other users? 

Highlighted

This change is currently rolling out in the server side, so there might be some delays for the APIs to work like also noted in the CSOM release blog post. We need to get things out before we can enable the APIs.

 

If the issue still exists within upcoming week(s), we need to have a closer look on this and would suggest submitting an issue at http://aka.ms/spdev-issues, so that we can trace that using our official process. 

Highlighted

Thanks for the response. I'll keep monitoring the feature and see if it starts working in upcoming weeks. The SharePoint Client Browser is ready for checked out files, check out the latest release for SharePoint Online. 

 

Keep you posted on updates when it starts working ;)

Highlighted
It will give count only if Files are in "No Checked-in File version". For me it returns count but "TakeOverCheckOut" method not working.

Highlighted

Hi Paul, it's been a while. But what is your experience now? It looks I still have the same behavior.

Highlighted

Hi Bram, same here: still not returning the expected results...