1

My list is in Sharepoint Online. I want to do pagination of list data in my custom page.

1st page code link:

 https://xxx/_api/web/lists/getbytitle('abc')/items?&$top=5

2nd page code link:

   https://xxx/_api/web/lists/getbytitle('abc')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d8&$top=5



Above code is working fine because there is not order by in above code but when I add order by code it will not work as required.

1st page code link:

https://xxx/_api/web/lists/getbytitle('abc')/items?&$top=5&$orderby=Last_x0020_Modified%20desc

2nd page code link:

https://xxx/_api/web/lists/getbytitle('abc')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d177&=&$top=5&$orderby=Last_x0020_Modified%20desc

Both the calls return same value because pagination works in greater id which is passed as "p_ID=177". Is there any alternative to do the pagination in sharepoint with order by clause in rest call?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.