Mar 18 2024 08:47 PM - edited Mar 18 2024 08:50 PM
I am encountering an unexpected behavior while using the SharePoint REST API for querying list items. Specifically, when I utilize the following REST API query to retrieve items from the "Training schedule" list in descending order:
/_api/web/lists/getByTitle('Training%20schedule')/items?$skiptoken=Paged%3DTRUE%26p_ID%3D0&$orderby=ID%20desc&$top=500
I do not receive any results.
However, when I use the same query in ascending order:
/_api/web/lists/getByTitle('Training%20schedule')/items?$skiptoken=Paged%3DTRUE%26p_ID%3D0&$orderby=ID%20asc&$top=500
I am able to retrieve the expected items.
Additional Details:
Expected Outcome: I expect the descending order query ($orderby=ID%20desc) to return the same results as the ascending order query when using the $skiptoken parameter.
Request for Assistance: Could you please assist me in identifying the cause of this issue and provide guidance on how to resolve it? Additionally, if there are any alternative approaches or workarounds to achieve the desired result, I would greatly appreciate your insights.
Thank you for your attention to this matter.