Skip to main content
April 23, 2024
Solved

How can I page a list

  • April 23, 2024
  • 6 replies
  • 0 views

I have a list, how can I do something like what pagingInfo does? I want to pass in batchNumber and batchSize and get the part from the list.

The list is not queried from record, it is from an api response, but the api response was not paged. I was blocked when I tried to create a record type using this api, so I was thinking maybe I can page the response in recordDataSource file. Is there any other ways that I can do this without changing the api?

    Best answer by venkatrea696188

    Convert  it into Datasubset by wrapping it in  todatsubset(), where you can use sorting and paging.

    I was blocked when I tried to create a record type using this api, so I was thinking maybe I can page the response in recordDataSource file.

    Can i know what you mean by this, i'm not able to understand it properly 

    6 replies

    venkatrea696188
    April 23, 2024

    Convert  it into Datasubset by wrapping it in  todatsubset(), where you can use sorting and paging.

    I was blocked when I tried to create a record type using this api, so I was thinking maybe I can page the response in recordDataSource file.

    Can i know what you mean by this, i'm not able to understand it properly 

    April 23, 2024

    Thank you! I got this warning when configure the datasource and can not proceed: "The Record Data Source cannot return more than 1,000 records in a single batch. Batch size was 2,174"

    stefanhelzle0001
    Brainy
    April 23, 2024

    Does that API not support any kind of paging? If the data volume increases, you will run into timeout or memory issues sooner or later.

    gopalk2865
    Participating Frequently
    April 23, 2024

    you can convert your data into datasubset using todatasubset() function. something like below

    todatasubset
    {
     your data from Api
      },
      a!pagingInfo(startIndex: 1, batchSize: 10)
    )

    once you have datasubset you can easily use in paging grid.

    April 23, 2024

    Got it, thank you!

    rohitm7223
    April 23, 2024

    Option 1: It is highly recommended to implement pagination at the API level if it fits your use case. This approach would be optimal.

    Option 2: Consider using the datasubset function to create a subset of the entire dataset you received, which can then be utilized in the grid.