Paginated record is not working

Topic Labels: Sync
756 2
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

I am trying to retrieve data with pagination, but its not returning the value.

export default async function fetchData() {
  let data = []
      pageSize: 3,
      view: 'Grid view',
      function page(records, fetchNextPage) {
        data = [, ...records]

        // fetchNextPage();
        console.log(data) // this shows result as expected
        return data // this doesn't work
      function done(err) {
        if (err) {

when I call this function from frontend I can see the values from console.log statement, but it doesn’t return the data array.

2 Replies 2

Hi @Farhan_Farooq,
You have to add the offset to your fetch.


The server returns one page of records at a time. Each page will contain pageSize records, which is 100 by default.

If there are more records, the response will contain an offset. To fetch the next page of records, include offset in the next request’s parameters.

Pagination will stop when you’ve reached the end of your table. If the maxRecords parameter is passed, pagination will stop once you’ve reached this maximum.

I am not even calling the fetchNextPage function, console log shows data from first page but even that data is not available to consume in frontend. Can you share the resource regarding offset?
Thank you