2

I am trying to apply paging in a SharePoint list. Everything works fine with the following query:

const queryUrl = `${context.pageContext.web.absoluteUrl}`
        + `/_api/web/lists/GetByTitle('MyList')/Items?`
        + `%24skiptoken=Paged%3DTRUE`
        + ((pageNumber > 1)
          ? `%26p_ID%3D${(pageNumber-1)*pageSize}`
          : ``)
        + `&%24top=${pageSize}`
      

The problem is I want to apply filtering and sorting on fields in the list. In this case, I want to apply paging based on SequenceNumber field rather than ID.

I tried using p_SequenceNumber in query but it didn't work. Is there any way to achieve this?

 const queryUrl = `${context.pageContext.web.absoluteUrl}`
        + `/_api/web/lists/GetByTitle('MyList')/Items?`        /
        /+ `$filter=Enabled eq 1&`
         + `%24skiptoken=Paged%3DTRUE`
        + ((pageNumber > 1)
          ? `%26p_SequenceNumber%3D${sequenceNumberToSkip}` //Doesn't work
          : ``)
        + `&%24top=${pageSize}`
        +`&$orderby= SequenceNumber asc`
        ;
        ;

0

Your Answer

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