-
Notifications
You must be signed in to change notification settings - Fork 317
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Add fields and filters to 'spo folder list' #4659
Comments
I'm interested in doing this one too! Should we drop And also checking for the threshold here by doing a call to |
Yes, let's drop the paging props here as well and just query everything using skip and top |
I updated the specs |
The spo listitem list has some useful features that are not available on spo folder list
As a user, I want to:
(additional: - request folders in a library that contains more than 5000 items)
We need the following options to make this work:
--fields [fields]
--filter [filter]
Additional Information
The
/folders
endpoint has NO nextlink/skiptoken implementation like with listitems. We can implement paging though, using$top
and$skip
. This is a less solid implementation of paging, but useful nonetheless.To be able to query all items we also have to refactor the endpoint that is used and move from the current
$expand
setup to using/folders
.The following steps should be taken:
Query
GetFolderByServerRelativePath(decodedurl='<folder>')?$expand=Properties&$select=Properties/vti_x005f_folderitemcount,Properties/vti_x005f_foldersubfolderitemcount
on the root folder that is coming in through the options.Next, use
GetFolderByServerRelativePath('somefolder')/Folders
endpoint to query all folders directly below, with$skip
and$top
. (Default$take
to 5000) Use the Properties to calculate how many calls you need to do here.When the
recursive
flag is set, restart step 1-2 on every subfolder coming in from the/Folders
calls.Important: Use the
--filter
option value for all/Folders
calls.When the
--fields
option includes values with a/
, for example:ListItemAllFields/Id
, an additional$expand
query parameter should be included onListItemAllFields
.When the
--fields
option includes values with a/
, for example:ListItemAllFields/Id
, an additional$expand
query parameter should be included onListItemAllFields
.Originally posted by @martinlingstuyl in #4654
The text was updated successfully, but these errors were encountered: