Skip to Content
Technical Articles

Connector Builder Guide – Cursor Pagination

Connector Builder Guide – Cursor Pagination

Open Connectors consists of over 170 connectors to 3rd Party Applications natively embedded in the SAP ecosystem. If the Connector you need does not exist in the catalog, you can build it quickly with Connector Builder. This instruction guide will walk you through using this tool, with concrete examples throughout. The beginning, Part 1, can be found here.

 

Cursor pagination fetches the next count rows after a specific reference point and is faster for large data sets. A cursor refers to a random string of characters which marks a specific item (the reference point) in a list of data. In this Stripe API example, Stripe uses these three parameters: limit, starting_after, and ending_before.

When creating a resource, the Connector Builder has two normalized query parameters, called nextPage and pageSize. To adhere to this normalization, we can add parameters to the resources like so in the Resources screen of Connector Builder:

 

A limit on the number of objects to be returned, between 1 and 100 is achieved using the limit parameter. This is mapped to pageSize in Connector Builder.

The starting_after parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 50 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. When this is mapped to nextPage in Connector Builder, the returned elements-next-page-token can be used to cursor through to the next set of records:

In the example above, limit was set to 50, and the nextPage was left blank. To get the next page, I can again set limit to 50 and this time, I’ll populate the nextPage with the returned elements-next-page-token.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.