When using the ItemCount
function on the /
folder, the count is 0.
The result of GET /_api/web/GetFolderByServerRelativeUrl('/')/ItemCount
is:
{
"d": {
"ItemCount": 0
}
}
But the content is actually not empty as it contains all the system related files as well as the user created libraries.
I can't seem to find anything about this on google or the sharepoint api documentation.
Is there another way to get it? I know it's possible to count items in a library using the list functions, but a folder is not list.
GetFolderByServerRelativeUrl
returns items only and only if they are located at the very level specified inside the('<level>')
? That means that your query would return theItemCount
of items at the/
-level of your hierarchy, but not below that level./
-level, this is precisely what I'm trying to access. There are in reality 13 folders and 2 files that are returned at that level when not using theItemCount
function. That's why I'm confused