Trying to figure out a way to use REST or JSOM to find all checkedout files in a library. I can use a list view to show which files are checked out and by whom, but there is no way to see how long ago it was checked out and I need this information. I need to do this from the client side/in-browser.
I found this thread about viewing the CheckedOutDate column, but the approved answer doesn't make sense to me and I assume it is something that you need central admin access.
$item = $web.lists[...].items[...] $checkedOutDate= $item.File.CheckedOutDate.ToString()
I thought I might try REST and found this post which talks about this endpoint.
/_api/web/lists/getbytitle('Documents')/items?$filter=CheckoutUserId ne null
But that throws
Column CheckoutUserId does not exist error. But when I remove the filter I can see the CheckoutUserId in the list of columns returned and when I check the Fields endpoint I do see the field and saw that it also has a different name CheckedOutUserId. And I am able to filter on that property.
After that I've got a list of checked out files, but I still can't get when it was checked out. I don't see that field anywhere. Does anyone know how to get that date?