Share via

How to sort users API and Items API based on createdDateTime

sravanakumar_d 0 Reputation points
2024-03-06T10:05:48.78+00:00
  1. we have scenario where we capture all cursors and hit them independently.
  2. for this we are taking @odata.nextLink from every page and storing .
  3. when ever any failure happens , we store this token and hit all these failure pages again with their respected tokens.
  4. this needs confirmation that all cursors should return same results even though any item addition-deletion.
  5. this can be possible when we sort then by createdDateTime, so that latest additions will add in the end.
  6. current items sort is not working properly, I used graph sdk
    <groupId>com.microsoft.graph</groupId> <artifactId>microsoft-graph</artifactId> <version>5.77.0</version>
  7. code DriveItemDeltaCollectionRequest req = getGraphClient().users(userId).drive().root().delta() .buildRequest(<requestOptions>); req.setMaxRetries(5); req.setDelay(5); return req.orderBy("createdDateTime").get();
  8. it is returning results where createdDateTime is not sorting order in each page.

please help on this

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,456 Reputation points
    2024-03-07T09:56:33.37+00:00

    Hi @sravanakumar_d

    As far as I know, the /users/{id}/drive/root/delta method does not currently support sorting by "createdDateTime" property.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.