heena shaikh
heena shaikh

Reputation: 23

How to apply pagination rule when next url is not present

How to apply pagination rule when web page gives me data as below

{ data:[], paging: { page:0, size:100, total_count:1190 } }

baseurl?page=0&size=100&respose_type=json

baseurl?page=1&size=100&respose_type=json

tried few solutions by dividing total_count/size to get the pages but missed few records.Is there any option in Query parameter ?

Upvotes: 0

Views: 621

Answers (1)

Rakesh Govindula
Rakesh Govindula

Reputation: 11529

AFAIK, You can use the Range option in the pagination.

Create a variable in the relative URL of the REST API and use that in pagination rules.

My sample:

Relative URL: users?take=100&skip={offest}

enter image description here

In Pagination rules, Give the Absolute URI and give the variable {offset} in pagination like below based on your requirement of page size. Here it will take 100 records and offset increases by 100 till 1190.

AbsoluteUrl {offset} Range 0 1190 100

enter image description here

For more information can go through this ans by MartinJaffer-MSFT

Upvotes: 0

Related Questions