Domanda

Simple query, I want to get the items ordered by id between 11-20 so I need to skip forst 10 items and than get 10 items.

I try retrieve them with the query below.

this.props.httpClient.get(`${this.siteUrl}/_api/web/lists/getbytitle('${this.props.listName}')/items?$select=Title,Id&$d.__next&$top=10`, 
    SPHttpClient.configurations.v1)
      .then(...)

but it always return first 10 items. There is no next object contains next 10 items as community claimed somehow I couldnt get it.

How can I fix it?

È stato utile?

Soluzione

The $skip parameter does not work in SharePoint 2013 for list items. It only works for collection of data (like list collections, etc).

You can use SharePoint 2010 REST API for achieve your result.

siteUrl + "_vti_bin/ListData.svc/Example?$skip=10&$top=10"

Altri suggerimenti

Maybe you can use the $skip token, as described

https://msdn.microsoft.com/en-us/library/dd541611.aspx

A data service URI with a $skip system query option identifies a subset of the entities in the collection of entities identified by the resource path section of the URI. That subset is defined by seeking N entities into the collection and selecting only the remaining entities (starting with entity N+1).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top