2

I am trying to orderby Created date in SharePoint Rest api

Below is the url that I use

/_api/web/getfolderbyserverrelativeurl('style%20library/Gallery')/Files?$expand=ListItemAllFields&$orderby=Created%20desc

I get the below error message

-1, Microsoft.SharePoint.Client.InvalidClientQueryException Field or property "Created" does not exist. Field or property "Created" does not exist. Microsoft.SharePoint.Client.InvalidClientQueryException

1 Answer 1

3

The problem is "Created" does not exist if you are playing with Files. You should use "TimeCreated" as a creation date in your query.

This is my query and it is working fine in my case:

_api/web/getfolderbyserverrelativeurl('PSD')/Files?$expand=ListItemAllFields&$orderby=TimeCreated%20desc
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.