You would be using different data sources that support large amounts of data. At times you may have data running in several hundred or thousands. Some of the connectors like that for Airtable return a maximum of 100 rows in response to the Find Rows API. So for this purpose Studio now has cursor-based pagination support that returns offset for the next page content instead of numeric pagination which is supported by the relational databases.
This feature uses the Offset value to scroll through various pages based on the previous page’s offset value.
For the different connectors like Airtable, MongoDB, and so on your API response would contain a key that points to the next page OFFSET.
So to use cursor-based pagination you need to enable the cursor-based pagination under Connector configuration.
Here you need to specify the key from the API response that points to the next page Offset under “Select cursor offset key”. You might also find the has more data key which denotes if there is more data to come or not.
Whenever you bind data from connectors to a table grid control, the Offset Key from the API request can be used as the table grid’s offset property for pagination.
Enable the Cursor based pagination and click Finish.
Using cursor-based pagination with TableGrid
If you are using any of these connectors whose API supports cursor-based pagination, you would typically be using table grid control to display data, then in that case under Pagination properties, you need to select Pagination Type as Cursor Based pagination.
Now when you select the respective connector to bind the data, you should enable Allow Pagination, so that the value will be directly bound to the control when you save the formula.
Optionally, if you are using Bind data > Connectors then you need not enable the Pagination > Allow pagination mentioned above.
Let us take an example here to bind an Airtable database to the Table grid control. Now when you configure the connector there would be a few things that you have to make sure that you set the Offset for table grid control to tablegrid.PROPERTIES.OFFSET. In this case, what happens is that this is the OFFSET value that is obtained by using the previous page’s API response. Add the Page Size when you want to use the Pagination.
You can click View Raw response to see the OFFSET key value as API response.
Now if you take a preview of the Table grid control the pagination would be done based on these OFFSET key values. In this example let us add a text control below the table grid control so that we can see the changing OFFSET key values.
Here if you see the offset key-value displayed in the text control. This would be the vital key that would be used for pagination. So when you move to the next page you can see that the offset key value has been changed.
For those connectors where the Cursor based pagination is necessary make sure that you enable Cursor based pagination for the table grid control and configure the connector accordingly. Remember that you cannot jump to a specific page using cursor-based pagination as the offset key value points to the next page.